Skip to content

Commit

Permalink
Merge pull request #79 from maxkatz6/fix-tail-opcode-convertion
Browse files Browse the repository at this point in the history
Fix tail opcode conversion
  • Loading branch information
kekekeks authored Nov 15, 2022
2 parents abed16a + 18f0ccc commit cd3682c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/XamlX.IL.Cecil/CecilEmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,17 @@ static CecilEmitter()

{
var sre = (SreOpCode) sreField.GetValue(null);
var cecilField = typeof(OpCodes).GetField(sreField.Name);
if(cecilField == null)

var cecil = sreField.Name switch
{
nameof(SreOpCodes.Tailcall) => OpCodes.Tail,
string name => (OpCode?)typeof(OpCodes).GetField(name)?.GetValue(null),
_ => null
};
if(cecil == null)
continue;
var cecil = (OpCode)cecilField.GetValue(null);
Dic[sre] = cecil;
}
Dic[sre] = cecil.Value;
}
}


Expand Down

0 comments on commit cd3682c

Please sign in to comment.