File tree 1 file changed +8
-2
lines changed
csharp/ql/src/semmle/code/cil
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,11 @@ module Opcodes {
167
167
class Neg extends UnaryExpr , @cil_neg {
168
168
override string getOpcodeName ( ) { result = "neg" }
169
169
170
- override NumericType getType ( ) { result = getOperand ( 0 ) .getType ( ) }
170
+ override NumericType getType ( ) {
171
+ result = getOperand ( ) .getType ( )
172
+ or
173
+ getOperand ( ) .getType ( ) instanceof Enum and result instanceof IntType
174
+ }
171
175
}
172
176
173
177
// Binary operations
@@ -1176,7 +1180,9 @@ module Opcodes {
1176
1180
class Localloc extends Expr , @cil_localloc {
1177
1181
override string getOpcodeName ( ) { result = "localloc" }
1178
1182
1179
- override int getPopCount ( ) { result = 1 } // ??
1183
+ override int getPopCount ( ) { result = 1 }
1184
+
1185
+ override PointerType getType ( ) { result .getReferentType ( ) instanceof ByteType }
1180
1186
}
1181
1187
1182
1188
class Readonly extends Instruction , @cil_readonly {
You can’t perform that action at this time.
0 commit comments