You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ILGenerator.BeginFinallyBlock example is invalid #3592
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidProgramException: Common Language Runtime detected an invalid program.
at Adder.DoAdd(Int32 , Int32 )
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
at ILGenerator_BeginFinallyBlock.Main() in C:\code\tmp\coreapp\Program.cs:line 109
I think the example should be changed, so that it produces valid IL.
If you would like to work on this, @garg000dhruv, that would be really great. .
Incidentally, although the ECMA spec explicitly disallows a return from a try region, it was not enforced until the new 64-bit JIT compiler introduced in the .NET Framework 4.6. See "IL ret not allowed in a try region" in the list of app compat issues between 4.5 and 4.6.
@rpetrusha That's what I was wondering because when I run the example on my machine, it runs just fine. I'll try with the updated specs and see what happens. But yeah I'd love to take this one up.
@garg000dhruv, you can start work on this issue. I've removed the up-for-grabs label. Since the issue is not part of a project, though, it can't be moved to either to-do or in-progress. We'll set the milestone when your PR arrives.
Activity
mairaw commentedon Oct 9, 2017
Thanks @svick for reporting this issue. We're adding this item to our backlog.
garg000dhruv commentedon Oct 19, 2017
@mairaw I can take this up if you'd like.
rpetrusha commentedon Oct 19, 2017
If you would like to work on this, @garg000dhruv, that would be really great. .
Incidentally, although the ECMA spec explicitly disallows a return from a try region, it was not enforced until the new 64-bit JIT compiler introduced in the .NET Framework 4.6. See "IL ret not allowed in a try region" in the list of app compat issues between 4.5 and 4.6.
garg000dhruv commentedon Oct 19, 2017
@rpetrusha That's what I was wondering because when I run the example on my machine, it runs just fine. I'll try with the updated specs and see what happens. But yeah I'd love to take this one up.
garg000dhruv commentedon Oct 20, 2017
@mairaw Let me know if I can start work on this. I only asl because I didn't see the
up-for-grabslabel removed or the issue moved toto-do.rpetrusha commentedon Oct 20, 2017
@garg000dhruv, you can start work on this issue. I've removed the up-for-grabs label. Since the issue is not part of a project, though, it can't be moved to either to-do or in-progress. We'll set the milestone when your PR arrives.