Skip to content

Commit

Permalink
Restore bool/char array ldelem/stelem instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfsck committed Nov 22, 2013
1 parent 2828d57 commit 52668b9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public bool Restore(MethodDef method) {
newOpCode = OpCodes.Ldelem_Ref;
else {
switch (operandTypeTmp.ElementType) {
case ElementType.Boolean: newOpCode = OpCodes.Ldelem_I1; break;
case ElementType.Char: newOpCode = OpCodes.Ldelem_U2; break;
case ElementType.I: newOpCode = OpCodes.Ldelem_I; break;
case ElementType.I1: newOpCode = OpCodes.Ldelem_I1; break;
case ElementType.I2: newOpCode = OpCodes.Ldelem_I2; break;
Expand Down Expand Up @@ -82,8 +84,10 @@ public bool Restore(MethodDef method) {
switch (operandTypeTmp.ElementType) {
case ElementType.U:
case ElementType.I: newOpCode = OpCodes.Stelem_I; break;
case ElementType.Boolean:
case ElementType.U1:
case ElementType.I1: newOpCode = OpCodes.Stelem_I1; break;
case ElementType.Char:
case ElementType.U2:
case ElementType.I2: newOpCode = OpCodes.Stelem_I2; break;
case ElementType.U4:
Expand Down

0 comments on commit 52668b9

Please sign in to comment.