Skip to content
Browse files

[Build] Fixed ErrorHelper local variable

We need to emit a ldloca instruction before constructing the
ErrorHelper instance, in order to reference it in the finally
block below.
  • Loading branch information...
1 parent 2f3e7a9 commit 18ef63461066632e9916ad47ef2d4f7bb9fba7de @thefiddler thefiddler committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/Generator.Rewrite/Program.cs
4 Source/Generator.Rewrite/Program.cs
@@ -363,9 +363,9 @@ static DebugVariables EmitDebugPrologue(MethodDefinition wrapper, ILProcessor il
vars.ErrorHelperLocal = new VariableDefinition(vars.ErrorHelperType);
- // var helper = new ErrorHelper(GraphicsContext.CurrentContext);
+ // using (new ErrorHelper(GraphicsContext.CurrentContext)) { ...
- //il.Emit(OpCodes.Ldarga, vars.ErrorHelperLocal); // todo: fix this
+ il.Emit(OpCodes.Ldloca, vars.ErrorHelperLocal);
il.Emit(OpCodes.Call, vars.Get_CurrentContext);
il.Emit(OpCodes.Call, ctor);

0 comments on commit 18ef634

Please sign in to comment.
Something went wrong with that request. Please try again.