Skip to content

Commit b3a7090

Browse files
committed
C++: Fix join in reachesRefParameter by joining with 'getEnd' instead
of 'getANode'. Before: Tuple counts for FlowVar::FlowVar::reachesRefParameter_dispred#ff/2@956ac39i after 229ms: 24806 ~1% {2} r1 = JOIN FlowVar::FlowVar_internal::parameterIsNonConstReference#f WITH Parameter::Parameter::getFunction_dispred#ff ON FIRST 1 OUTPUT Lhs.0 'p', Rhs.1 56985 ~3% {3} r2 = JOIN r1 WITH num#FlowVar::FlowVar_internal::TBlockVar#fff_12#join_rhs ON FIRST 1 OUTPUT Rhs.1 'this', Lhs.0 'p', Lhs.1 2384489 ~4% {4} r3 = JOIN r2 WITH FlowVar::FlowVar_internal::getAReachedBlockVarSBB#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.2, Lhs.1 'p', Lhs.0 'this' 49457 ~0% {2} r4 = JOIN r3 WITH SubBasicBlocks::SubBasicBlock::getANode_dispred#fb ON FIRST 2 OUTPUT Lhs.3 'this', Lhs.2 'p' return r4 After: Tuple counts for FlowVar::FlowVar::reachesRefParameter_dispred#ff/2@46f8bfn7 after 32ms: 24806 ~1% {2} r1 = JOIN FlowVar::FlowVar_internal::parameterIsNonConstReference#f WITH Parameter::Parameter::getFunction_dispred#ff ON FIRST 1 OUTPUT Lhs.0 'p', Rhs.1 56985 ~1% {3} r2 = JOIN r1 WITH num#FlowVar::FlowVar_internal::TBlockVar#fff_12#join_rhs ON FIRST 1 OUTPUT Lhs.1, Lhs.0 'p', Rhs.1 'this' 56985 ~1% {3} r3 = JOIN r2 WITH SubBasicBlocks::SubBasicBlock::getEnd_dispred#fb_10#join_rhs ON FIRST 1 OUTPUT Lhs.2 'this', Rhs.1, Lhs.1 'p' 49457 ~0% {2} r4 = JOIN r3 WITH FlowVar::FlowVar_internal::getAReachedBlockVarSBB#ff ON FIRST 2 OUTPUT Lhs.0 'this', Lhs.2 'p' return r4
1 parent d912a98 commit b3a7090

File tree

1 file changed

+1
-1
lines changed
  • cpp/ql/lib/semmle/code/cpp/dataflow/internal

1 file changed

+1
-1
lines changed

cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowVar.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ module FlowVar_internal {
435435
parameterIsNonConstReference(p) and
436436
p = v and
437437
// This definition reaches the exit node of the function CFG
438-
getAReachedBlockVarSBB(this).getANode() = p.getFunction()
438+
getAReachedBlockVarSBB(this).getEnd() = p.getFunction()
439439
}
440440

441441
override predicate definedByInitialValue(StackVariable lsv) {

0 commit comments

Comments
 (0)