File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
rust/ql/src/queries/security/CWE-696 Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,18 @@ class PathElement = AstNode;
44
44
* reachable from a source.
45
45
*/
46
46
predicate edgesFwd ( PathElement pred , PathElement succ ) {
47
- // attribute (source) -> callable
48
- pred .( CtorAttr ) = succ .( Callable ) .getAnAttr ( )
47
+ // attribute (source) -> function in macro expansion
48
+ exists ( Function f |
49
+ pred .( CtorAttr ) = f .getAnAttr ( ) and
50
+ (
51
+ f .getAttributeMacroExpansion ( ) .getAnItem ( ) = succ .( Callable )
52
+ or
53
+ // if for some reason the ctor/dtor macro expansion failed, fall back to looking into the unexpanded item
54
+ not f .hasAttributeMacroExpansion ( ) and f = succ .( Callable )
55
+ )
56
+ )
49
57
or
58
+ // callable -> callable attribute macro expansion
50
59
// [forwards reachable] callable -> enclosed call
51
60
edgesFwd ( _, pred ) and
52
61
pred = succ .( CallExprBase ) .getEnclosingCallable ( )
You can’t perform that action at this time.
0 commit comments