Skip to content

Commit 512c10e

Browse files
committed
C++: Use the fully converted expression when converting models to dataflow nodes.
1 parent be16cb4 commit 512c10e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ predicate instructionForFullyConvertedCall(Instruction instr, CallInstruction ca
555555
}
556556

557557
/** Holds if `node` represents the output node for `call`. */
558-
private predicate simpleOutNode(Node node, CallInstruction call) {
558+
predicate simpleOutNode(Node node, CallInstruction call) {
559559
operandForFullyConvertedCall(node.asOperand(), call)
560560
or
561561
instructionForFullyConvertedCall(node.asInstruction(), call)

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
private import semmle.code.cpp.ir.IR
77
private import semmle.code.cpp.ir.dataflow.DataFlow
88
private import DataFlowUtil
9+
private import DataFlowPrivate
910
private import SsaInternals as Ssa
1011

1112
/**
@@ -35,7 +36,7 @@ DataFlow::Node callInput(CallInstruction call, FunctionInput input) {
3536
*/
3637
Node callOutput(CallInstruction call, FunctionOutput output) {
3738
// The return value
38-
result.asInstruction() = call and
39+
simpleOutNode(result, call) and
3940
output.isReturnValue()
4041
or
4142
// The side effect of a call on the value pointed to by an argument or qualifier
@@ -82,7 +83,7 @@ Node callOutput(CallInstruction call, FunctionOutput output, int d) {
8283
// If there isn't an indirect out node for the call with indirection `d` then
8384
// we conflate this with the underlying `CallInstruction`.
8485
not exists(getIndirectReturnOutNode(call, d)) and
85-
n.asInstruction() = result.asInstruction()
86+
n = result
8687
or
8788
// The side effect of a call on the value pointed to by an argument or qualifier
8889
exists(Operand operand, int indirectionIndex |

0 commit comments

Comments
 (0)