File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1394,11 +1394,21 @@ abstract private class ExprNodeBase extends Node {
1394
1394
final Expr getExpr ( int n ) { result = this .getConvertedExpr ( n ) .getUnconverted ( ) }
1395
1395
}
1396
1396
1397
+ /**
1398
+ * Holds if there exists a dataflow node whose `asExpr(n)` should evaluate
1399
+ * to `e`.
1400
+ */
1401
+ private predicate exprNodeShouldBe ( Expr e , int n ) {
1402
+ exprNodeShouldBeInstruction ( _, e , n ) or
1403
+ exprNodeShouldBeOperand ( _, e , n ) or
1404
+ exprNodeShouldBeIndirectOutNode ( _, e , n )
1405
+ }
1406
+
1397
1407
private class InstructionExprNode extends ExprNodeBase , InstructionNode {
1398
1408
InstructionExprNode ( ) {
1399
1409
exists ( Expr e , int n |
1400
1410
exprNodeShouldBeInstruction ( this , e , n ) and
1401
- not exprNodeShouldBeInstruction ( _ , e , n + 1 )
1411
+ not exprNodeShouldBe ( e , n + 1 )
1402
1412
)
1403
1413
}
1404
1414
@@ -1409,7 +1419,7 @@ private class OperandExprNode extends ExprNodeBase, OperandNode {
1409
1419
OperandExprNode ( ) {
1410
1420
exists ( Expr e , int n |
1411
1421
exprNodeShouldBeOperand ( this , e , n ) and
1412
- not exprNodeShouldBeOperand ( _ , e , n + 1 )
1422
+ not exprNodeShouldBe ( e , n + 1 )
1413
1423
)
1414
1424
}
1415
1425
You can’t perform that action at this time.
0 commit comments