Skip to content

Commit 8d037da

Browse files
authored
Merge pull request #1818 from jbj/lambda_capture-upgrade-perf
C++: Fix lambda_capture upgrade query join order
2 parents 2590019 + 52e4058 commit 8d037da

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

cpp/upgrades/814fae599505510ff15102f4c72600586734770a/lambda_capture.ql

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,22 @@ class Field extends @membervariable { string toString() { none() } }
55
class Location extends @location_default { string toString() { none() } }
66
class Type extends @usertype { string toString() { none() } }
77

8+
pragma[noopt]
9+
predicate lambda_capture_new(LambdaCapture lc, Lambda l, int i, Field f,
10+
boolean captured_by_reference, boolean is_implicit,
11+
Location loc)
12+
{
13+
exists(Type t |
14+
lambda_capture(lc, l, i, captured_by_reference, is_implicit, loc) and
15+
expr_types(l, t, _) and
16+
t instanceof Type and
17+
member(t, i, f) and
18+
f instanceof Field
19+
)
20+
}
21+
822
from LambdaCapture lc, Lambda l, int i, Field f,
923
boolean captured_by_reference, boolean is_implicit,
10-
Location loc, Type t
11-
where lambda_capture(lc, l, i, captured_by_reference, is_implicit, loc)
12-
and expr_types(l, t, _)
13-
and member(t, i, f)
24+
Location loc
25+
where lambda_capture_new(lc, l, i, f, captured_by_reference, is_implicit, loc)
1426
select lc, l, i, f, captured_by_reference, is_implicit, loc
15-

0 commit comments

Comments
 (0)