File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,13 @@ private import semmle.code.cpp.dataflow.EscapesTree
6
6
/**
7
7
* A C/C++ access expression. This refers to a function, variable, or enum constant.
8
8
*/
9
- abstract class Access extends Expr , NameQualifiableElement {
9
+ class Access extends Expr , NameQualifiableElement , @access {
10
+ // As `@access` is a union type containing `@routineexpr` (which describes function accesses
11
+ // that are called), we need to exclude function calls.
12
+ Access ( ) { this instanceof @routineexpr implies not iscall ( underlyingElement ( this ) , _) }
13
+
10
14
/** Gets the accessed function, variable, or enum constant. */
11
- abstract Declaration getTarget ( ) ;
15
+ Declaration getTarget ( ) { none ( ) } // overridden in subclasses
12
16
13
17
override predicate mayBeImpure ( ) { none ( ) }
14
18
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ private import semmle.code.cpp.internal.ResolveClass
7
7
* Instances of this class are not present in the main AST which is navigated by parent/child links. Instead,
8
8
* instances of this class are attached to nodes in the main AST via special conversion links.
9
9
*/
10
- abstract class Conversion extends Expr {
10
+ class Conversion extends Expr , @conversion {
11
11
/** Gets the expression being converted. */
12
12
Expr getExpr ( ) { result .getConversion ( ) = this }
13
13
Original file line number Diff line number Diff line change @@ -1143,6 +1143,13 @@ conversionkinds(
1143
1143
int kind: int ref
1144
1144
);
1145
1145
1146
+ @conversion = @cast
1147
+ | @array_to_pointer
1148
+ | @parexpr
1149
+ | @reference_to
1150
+ | @ref_indirect
1151
+ ;
1152
+
1146
1153
/*
1147
1154
case @funbindexpr.kind of
1148
1155
0 = @normal_call // a normal call
@@ -1800,6 +1807,8 @@ lambda_capture(
1800
1807
@addressable = @function | @variable ;
1801
1808
@accessible = @addressable | @enumconstant ;
1802
1809
1810
+ @access = @varaccess | @routineexpr ;
1811
+
1803
1812
fold(
1804
1813
int expr: @foldexpr ref,
1805
1814
string operator: string ref,
You can’t perform that action at this time.
0 commit comments