File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
cpp/ql/lib/semmle/code/cpp Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -109,10 +109,7 @@ class Element extends ElementBase {
109
109
then
110
110
exists ( MacroInvocation mi |
111
111
this = mi .getAGeneratedElement ( ) and
112
- not exists ( MacroInvocation closer |
113
- this = closer .getAGeneratedElement ( ) and
114
- mi = closer .getParentInvocation + ( )
115
- ) and
112
+ not hasCloserMacroInvocation ( this , mi ) and
116
113
result = mi .getMacro ( )
117
114
)
118
115
else result = this
@@ -236,6 +233,14 @@ class Element extends ElementBase {
236
233
}
237
234
}
238
235
236
+ pragma [ noinline]
237
+ private predicate hasCloserMacroInvocation ( Element elem , MacroInvocation mi ) {
238
+ exists ( MacroInvocation closer |
239
+ elem = closer .getAGeneratedElement ( ) and
240
+ mi = closer .getParentInvocation ( )
241
+ )
242
+ }
243
+
239
244
private predicate isFromTemplateInstantiationRec ( Element e , Element instantiation ) {
240
245
instantiation .( Function ) .isConstructedFrom ( _) and
241
246
e = instantiation
You can’t perform that action at this time.
0 commit comments