Skip to content

Commit 8cf53dd

Browse files
committed
C#: Update the DB scheme to consider unary expressions operator calls and add a new kind for NOT expressions.
1 parent 7543472 commit 8cf53dd

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

csharp/extractor/Semmle.Extraction.CSharp/Kinds/ExprKind.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public enum ExprKind
133133
COLLECTION = 136,
134134
SPREAD_ELEMENT = 137,
135135
INTERPOLATED_STRING_INSERT = 138,
136+
NOT = 139,
136137
DEFINE_SYMBOL = 999,
137138
}
138139
}

csharp/ql/lib/semmlecode.csharp.dbscheme

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,7 @@ case @expr.kind of
11981198
| 136 = @collection_expr
11991199
| 137 = @spread_element_expr
12001200
| 138 = @interpolated_string_insert_expr
1201+
| 139 = @not_expr
12011202
/* Preprocessor */
12021203
| 999 = @define_symbol_expr
12031204
;
@@ -1216,7 +1217,7 @@ case @expr.kind of
12161217
| @string_literal_expr | @null_literal_expr;
12171218

12181219
@assign_expr = @simple_assign_expr | @assign_op_expr | @local_var_decl_expr;
1219-
@assign_op_call_expr = @assign_arith_expr | @assign_bitwise_expr
1220+
@assign_op_call_expr = @assign_arith_expr | @assign_bitwise_expr;
12201221
@assign_op_expr = @assign_op_call_expr | @assign_event_expr | @assign_coalesce_expr;
12211222
@assign_event_expr = @add_event_expr | @remove_event_expr;
12221223

@@ -1263,6 +1264,7 @@ case @expr.kind of
12631264

12641265
@ternary_log_op_expr = @conditional_expr;
12651266
@bin_log_op_expr = @log_and_expr | @log_or_expr | @null_coalescing_expr;
1267+
@un_not_op_expr = @log_not_expr | @not_expr;
12661268
@un_log_op_expr = @log_not_expr;
12671269
@log_expr = @un_log_op_expr | @bin_log_op_expr | @ternary_log_op_expr;
12681270

@@ -1279,12 +1281,13 @@ case @expr.kind of
12791281

12801282
@ternary_op = @ternary_log_op_expr;
12811283
@bin_op = @assign_expr | @bin_arith_op_expr | @bin_log_op_expr | @bin_bit_op_expr | @comp_expr;
1282-
@un_op = @un_arith_op_expr | @un_log_op_expr | @un_bit_op_expr | @sizeof_expr
1284+
@un_op_call_expr = @un_arith_op_expr | @un_not_op_expr | @un_bit_op_expr;
1285+
@un_op = @un_op_call_expr | @sizeof_expr
12831286
| @pointer_indirection_expr | @address_of_expr;
12841287

12851288
@anonymous_function_expr = @lambda_expr | @anonymous_method_expr;
12861289

1287-
@op_invoke_expr = @operator_invocation_expr | @assign_op_call_expr
1290+
@op_invoke_expr = @operator_invocation_expr | @assign_op_call_expr | @un_op_call_expr;
12881291
@call = @method_invocation_expr | @constructor_init_expr | @op_invoke_expr
12891292
| @delegate_invocation_expr | @object_creation_expr | @call_access_expr
12901293
| @local_function_invocation_expr | @function_pointer_invocation_expr;
@@ -1311,7 +1314,7 @@ implicitly_typed_object_creation(
13111314
unique int id: @implicitly_typeable_object_creation_expr ref);
13121315

13131316
mutator_invocation_mode(
1314-
unique int id: @operator_invocation_expr ref,
1317+
unique int id: @mut_op_expr ref,
13151318
int mode: int ref /* prefix = 1, postfix = 2*/);
13161319

13171320
expr_value(

0 commit comments

Comments
 (0)