Skip to content

Commit

Permalink
[Build] Fixed ErrorHelper local variable
Browse files Browse the repository at this point in the history
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
thefiddler committed Feb 25, 2014
1 parent 2f3e7a9 commit 18ef634
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Generator.Rewrite/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.Body.Variables.Add(vars.ErrorHelperLocal);
//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);

Expand Down

0 comments on commit 18ef634

Please sign in to comment.