Skip to content

Commit 78756bd

Browse files
authored
Merge pull request #9859 from tausbn/python-fix-another-bad-value-transfer-join
2 parents d4d6657 + 2436b06 commit 78756bd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

python/ql/lib/semmle/python/pointsto/PointsTo.qll

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,12 +1271,21 @@ module InterProceduralPointsTo {
12711271
)
12721272
)
12731273
or
1274+
non_escaping_global_transfer(pred_var, pred_context, succ_def, succ_context)
1275+
}
1276+
1277+
pragma[nomagic]
1278+
private predicate non_escaping_global_transfer(
1279+
EssaVariable pred_var, PointsToContext pred_context, ScopeEntryDefinition succ_def,
1280+
PointsToContext succ_context
1281+
) {
12741282
exists(NonEscapingGlobalVariable var |
12751283
var = pred_var.getSourceVariable() and
12761284
var = succ_def.getSourceVariable() and
12771285
pred_var.getAUse() = succ_context.getRootCall() and
12781286
pred_context.isImport() and
1279-
succ_context.appliesToScope(succ_def.getScope())
1287+
pragma[only_bind_into](succ_context)
1288+
.appliesToScope(pragma[only_bind_into](succ_def).getScope())
12801289
)
12811290
}
12821291

0 commit comments

Comments
 (0)