Skip to content

Commit b2cc913

Browse files
authored
Python: Fix bad join in firstUse
This was what it looked like (at the point when I killed the evaluation): ``` Tuple counts for SsaCompute::SsaComputeImpl::AdjacentUsesImpl::firstUse#c5fa2be7#ff/2@i1#be98bwif after 1m50s: 274000 ~7% {4} r1 = SCAN SsaCompute::SsaComputeImpl::AdjacentUsesImpl::definesAt#c5fa2be7#ffff OUTPUT In.1, In.0 'def', In.2, In.3 2731768000 ~1% {7} r2 = JOIN r1 WITH SsaCompute::SsaComputeImpl::AdjacentUsesImpl::variableSourceUse#c5fa2be7#ffff ON FIRST 1 OUTPUT Rhs.0, Lhs.2, Lhs.3, Rhs.2, Rhs.3, Rhs.1 'use', Lhs.1 'def' 178000 ~4% {2} r3 = JOIN r2 WITH SsaCompute::SsaComputeImpl::AdjacentUsesImpl::adjacentVarRefs#c5fa2be7#fffff ON FIRST 5 OUTPUT Lhs.6 'def', Lhs.5 'use' return r3 ``` And this is what it looks like now: ``` Tuple counts for SsaCompute::SsaComputeImpl::AdjacentUsesImpl::firstUse#c5fa2be7#ff/2@i1#f9d6ewsi after 207ms: 931353 ~2% {4} r1 = SCAN SsaCompute::SsaComputeImpl::AdjacentUsesImpl::variableSourceUse#c5fa2be7#ffff OUTPUT In.0, In.2, In.3, In.1 'use' 1050477 ~0% {4} r2 = JOIN r1 WITH SsaCompute::SsaComputeImpl::AdjacentUsesImpl::adjacentVarRefs#c5fa2be7#fffff_03412#join_rhs ON FIRST 3 OUTPUT Lhs.0, Rhs.3, Rhs.4, Lhs.3 'use' 506626 ~0% {2} r3 = JOIN r2 WITH SsaCompute::SsaComputeImpl::AdjacentUsesImpl::definesAt#c5fa2be7#ffff_1230#join_rhs ON FIRST 3 OUTPUT Rhs.3 'def', Lhs.3 'use' return r3 ```
1 parent 4923326 commit b2cc913

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/ql/lib/semmle/python/essa/SsaCompute.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,8 @@ private module SsaComputeImpl {
496496
predicate firstUse(EssaDefinition def, ControlFlowNode use) {
497497
exists(SsaSourceVariable v, BasicBlock b1, int i1, BasicBlock b2, int i2 |
498498
adjacentVarRefs(v, b1, i1, b2, i2) and
499-
definesAt(def, v, b1, i1) and
500-
variableSourceUse(v, use, b2, i2)
499+
definesAt(def, pragma[only_bind_into](v), b1, i1) and
500+
variableSourceUse(pragma[only_bind_into](v), use, b2, i2)
501501
)
502502
or
503503
exists(

0 commit comments

Comments
 (0)