Skip to content

Commit a64c05a

Browse files
committed
CIL: Also extrat byte-sized operands.
1 parent bd70ab4 commit a64c05a

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

binary/extractor/cil/Semmle.Extraction.CSharp.IL/ILExtractor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ private void ExtractMethodBody(MethodDefinition method, int methodId) {
119119
trap.WriteTuple("il_call_target_unresolved", instrId, targetMethodName);
120120
} else if (instruction.Operand is string str) {
121121
trap.WriteTuple("il_operand_string", instrId, str);
122+
} else if (instruction.Operand is sbyte sb) {
123+
trap.WriteTuple("il_operand_sbyte", instrId, sb);
124+
} else if (instruction.Operand is byte b) {
125+
trap.WriteTuple("il_operand_byte", instrId, b);
122126
} else if (instruction.Operand is int i) {
123127
trap.WriteTuple("il_operand_int", instrId, i);
124128
} else if (instruction.Operand is long l) {

binary/ql/lib/semmlecode.binary.dbscheme

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,6 +2431,16 @@ il_operand_string(
24312431
string value: string ref
24322432
);
24332433

2434+
il_operand_sbyte(
2435+
int instruction: @il_instruction ref,
2436+
int value: int ref
2437+
);
2438+
2439+
il_operand_byte(
2440+
int instruction: @il_instruction ref,
2441+
int value: int ref
2442+
);
2443+
24342444
/**
24352445
* Integer operands for IL instructions.
24362446
* Used for ldc.i4 (load constant int32) and similar instructions.

0 commit comments

Comments
 (0)