Skip to content

Commit 0102d68

Browse files
authored
Merge pull request github#5658 from MathiasVP/fix-partial-def-diff-test
C++: Fix performance in test
2 parents fda750e + 037e636 commit 0102d68

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

cpp/ql/test/library-tests/dataflow/fields/partial-definition-diff.ql

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@ class IRPartialDefNode extends IRNode {
1919
override string toString() { result = n.asPartialDefinition().toString() }
2020
}
2121

22-
from Node node, AST::Node astNode, IR::Node irNode, string msg
22+
from Node node, string msg
2323
where
24-
node.asIR() = irNode and
25-
exists(irNode.asPartialDefinition()) and
26-
not exists(AST::Node otherNode | otherNode.asPartialDefinition() = irNode.asPartialDefinition()) and
24+
exists(IR::Node irNode, Expr partial |
25+
node.asIR() = irNode and
26+
partial = irNode.asPartialDefinition() and
27+
not exists(AST::Node otherNode | otherNode.asPartialDefinition() = partial)
28+
) and
2729
msg = "IR only"
2830
or
29-
node.asAST() = astNode and
30-
exists(astNode.asPartialDefinition()) and
31-
not exists(IR::Node otherNode | otherNode.asPartialDefinition() = astNode.asPartialDefinition()) and
31+
exists(AST::Node astNode, Expr partial |
32+
node.asAST() = astNode and
33+
partial = astNode.asPartialDefinition() and
34+
not exists(IR::Node otherNode | otherNode.asPartialDefinition() = partial)
35+
) and
3236
msg = "AST only"
3337
select node, msg

0 commit comments

Comments
 (0)