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
When the last statement in a TryCatch block is a goto and the label is on the outside, we encounter an System.InvalidProgramException: Common Language Runtime detected an invalid program. error. We haven’t been able to find a reliable workaround for this yet.
// FEC throws `System.InvalidProgramException: Common Language Runtime detected an invalid program.`varlabel=Label("label");varvariable=Variable(typeof(int),"variable");varblock=Block([variable],TryCatch(Block(Assign(variable,Constant(5)),Goto(label)),Catch(typeof(Exception),Block(typeof(void),Assign(variable,Constant(10))))),Label(label),variable);varlambda=Lambda<Func<int>>(block);
Additionally we also found that when the label is moved into the same scope as the goto we get System.ArgumentException: Bad label content in ILGenerator.
// FEC throws `System.ArgumentException: Bad label content in ILGenerator.`varlabel=Label("label");varvariable=Parameter(typeof(int));varexceptionParam=Parameter(typeof(Exception),"ex");varblock=Block([variable],TryCatch(Block(Goto(label),Throw(Constant(newException("Exception"))),Label(label),Assign(variable,Constant(2))),Catch(exceptionParam,Assign(variable,Constant(50)))),variable);varlambda=Lambda<Func<int>>(block);varcompiledLambda=lambda.CompileFast();
The text was updated successfully, but these errors were encountered:
See #438 for the context
When the last statement in a TryCatch block is a goto and the label is on the outside, we encounter an System.InvalidProgramException: Common Language Runtime detected an invalid program. error. We haven’t been able to find a reliable workaround for this yet.
Additionally we also found that when the label is moved into the same scope as the goto we get System.ArgumentException: Bad label content in ILGenerator.
The text was updated successfully, but these errors were encountered: