We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a64c05a commit a231572Copy full SHA for a231572
1 file changed
binary/extractor/cil/Semmle.Extraction.CSharp.IL/ILExtractor.cs
@@ -96,8 +96,11 @@ private void ExtractMethodBody(MethodDefinition method, int methodId) {
96
var instrId = trap.GetId();
97
98
// Basic instruction info
99
+ // This is super dumb: The instruction.OpCode returns a short instead of a ushort. So without the
100
+ // cast the value for a clt instruction (which has Value 0xFE01) does not fit in a short (which
101
+ // has max value 0x7FFF). So it underflows to a negative number.
102
trap.WriteTuple("il_instruction", instrId, instruction.Offset,
- (int)instruction.OpCode.Code);
103
+ (ushort)instruction.OpCode.Value);
104
105
trap.WriteTuple("il_instruction_method", instrId,
106
methodId);
0 commit comments