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 {
13941394 final Expr getExpr ( int n ) { result = this .getConvertedExpr ( n ) .getUnconverted ( ) }
13951395}
13961396
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+
13971407private class InstructionExprNode extends ExprNodeBase , InstructionNode {
13981408 InstructionExprNode ( ) {
13991409 exists ( Expr e , int n |
14001410 exprNodeShouldBeInstruction ( this , e , n ) and
1401- not exprNodeShouldBeInstruction ( _ , e , n + 1 )
1411+ not exprNodeShouldBe ( e , n + 1 )
14021412 )
14031413 }
14041414
@@ -1409,7 +1419,7 @@ private class OperandExprNode extends ExprNodeBase, OperandNode {
14091419 OperandExprNode ( ) {
14101420 exists ( Expr e , int n |
14111421 exprNodeShouldBeOperand ( this , e , n ) and
1412- not exprNodeShouldBeOperand ( _ , e , n + 1 )
1422+ not exprNodeShouldBe ( e , n + 1 )
14131423 )
14141424 }
14151425
You can’t perform that action at this time.
0 commit comments