Skip to content

Commit a4727b5

Browse files
committed
C++: Fix 'asExpr' duplication.
1 parent 79d9109 commit a4727b5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,10 @@ private class InstructionExprNode extends ExprNodeBase, InstructionNode {
14081408
InstructionExprNode() {
14091409
exists(Expr e, int n |
14101410
exprNodeShouldBeInstruction(this, e, n) and
1411-
not exprNodeShouldBe(e, n + 1)
1411+
not exists(Expr conv |
1412+
exprNodeShouldBe(conv, n + 1) and
1413+
conv.getUnconverted() = e.getUnconverted()
1414+
)
14121415
)
14131416
}
14141417

@@ -1419,7 +1422,10 @@ private class OperandExprNode extends ExprNodeBase, OperandNode {
14191422
OperandExprNode() {
14201423
exists(Expr e, int n |
14211424
exprNodeShouldBeOperand(this, e, n) and
1422-
not exprNodeShouldBe(e, n + 1)
1425+
not exists(Expr conv |
1426+
exprNodeShouldBe(conv, n + 1) and
1427+
conv.getUnconverted() = e.getUnconverted()
1428+
)
14231429
)
14241430
}
14251431

0 commit comments

Comments
 (0)