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;
4444 * reachable from a source.
4545 */
4646predicate 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+ )
4957 or
58+ // callable -> callable attribute macro expansion
5059 // [forwards reachable] callable -> enclosed call
5160 edgesFwd ( _, pred ) and
5261 pred = succ .( CallExprBase ) .getEnclosingCallable ( )
You can’t perform that action at this time.
0 commit comments