Skip to content

Commit 05cd251

Browse files
committed
C++: Map more expressions to operand nodes.
1 parent 0addae8 commit 05cd251

1 file changed

Lines changed: 3 additions & 24 deletions

File tree

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

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -770,32 +770,11 @@ class RawIndirectInstruction extends Node, TRawIndirectInstruction {
770770
}
771771
}
772772

773-
private predicate isFullyConvertedArgument(Expr e) {
774-
exists(Call call |
775-
e = call.getAnArgument().getFullyConverted()
776-
or
777-
e = call.getQualifier().getFullyConverted()
778-
)
779-
}
780-
781-
private predicate isFullyConvertedCall(Expr e) { e = any(Call call).getFullyConverted() }
782-
783-
/** Holds if `Node::asExpr` should map an some operand node to `e`. */
784-
private predicate convertedExprMustBeOperand(Expr e) {
785-
isFullyConvertedArgument(e)
786-
or
787-
isFullyConvertedCall(e)
788-
}
789-
790773
/** Holds if `node` is an `OperandNode` that should map `node.asExpr()` to `e`. */
791774
predicate exprNodeShouldBeOperand(OperandNode node, Expr e) {
792-
exists(Operand operand |
793-
node.getOperand() = operand and
794-
e = operand.getDef().getConvertedResultExpression()
795-
|
796-
convertedExprMustBeOperand(e)
797-
or
798-
node.(IndirectOperand).isIRRepresentationOf(_, _)
775+
exists(Instruction def |
776+
unique( | | getAUse(def)) = node.getOperand() and
777+
e = def.getConvertedResultExpression()
799778
)
800779
}
801780

0 commit comments

Comments
 (0)