Fix for IndexOutOfRangeException in ILReader.ReadOpCode(), part 2 (#84)
* Add failing test * Fix OperandType.ShortInlineI handling * Remove invalid comment
This commit is contained in:
parent
adef3aa266
commit
9b85871130
@ -72,6 +72,7 @@ namespace System.Diagnostics.Internal
|
|||||||
|
|
||||||
case OperandType.ShortInlineBrTarget:
|
case OperandType.ShortInlineBrTarget:
|
||||||
case OperandType.ShortInlineVar:
|
case OperandType.ShortInlineVar:
|
||||||
|
case OperandType.ShortInlineI:
|
||||||
inlineLength = 1;
|
inlineLength = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -97,7 +98,6 @@ namespace System.Diagnostics.Internal
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Can return System.ArgumentException : Unexpected operand type xxx
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -34,6 +34,10 @@ namespace Ben.Demystifier.Test
|
|||||||
40, 160, 4, 0, 6, 114, 253, 15, 0, 112, 115, 90, 0, 0, 10, 122, 254, 6, 32, 5, 0,
|
40, 160, 4, 0, 6, 114, 253, 15, 0, 112, 115, 90, 0, 0, 10, 122, 254, 6, 32, 5, 0,
|
||||||
6, 115, 137, 2, 0, 10, 115, 61, 2, 0, 6, 42
|
6, 115, 137, 2, 0, 10, 115, 61, 2, 0, 6, 42
|
||||||
} },
|
} },
|
||||||
|
|
||||||
|
{ new byte[] {
|
||||||
|
31, 254, 115, 42, 2, 0, 6, 37, 2, 125, 159, 0, 0, 4, 37, 3, 125, 158, 0, 0, 4, 42
|
||||||
|
} },
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://github.com/benaadams/Ben.Demystifier/issues/56
|
// https://github.com/benaadams/Ben.Demystifier/issues/56
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user