Skip to content

Commit 489e1e9

Browse files
authored
Python: Prevent bad joins
Adds a few unbinds to prevent bad joins from occurring. Firstly, we never want to join `StepSummary::step` with `TypeTracker::append` on `summary` as the first join, as the resulting relation is absolutely massive. So we decouple the two occurrences of `summary` by unbinding each of them. Secondly, in some cases the node we're stepping to (`nodeTo` for type trackers, `nodeFrom` for type backtrackers) will get joined eagerly with the typetracker one is defining, and again this produces an uncomfortably large intermediate join. A bit of unbinding prevents this as well.
1 parent 9e95f6e commit 489e1e9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/ql/src/experimental/typetracking/TypeTracker.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ class TypeTracker extends TTypeTracker {
227227
pragma[inline]
228228
TypeTracker step(LocalSourceNode nodeFrom, LocalSourceNode nodeTo) {
229229
exists(StepSummary summary |
230-
StepSummary::step(nodeFrom, nodeTo, summary) and
231-
result = this.append(summary)
230+
StepSummary::step(nodeFrom, pragma[only_bind_out](nodeTo), pragma[only_bind_into](summary)) and
231+
result = this.append(pragma[only_bind_into](summary))
232232
)
233233
}
234234

@@ -370,8 +370,8 @@ class TypeBackTracker extends TTypeBackTracker {
370370
pragma[inline]
371371
TypeBackTracker step(LocalSourceNode nodeFrom, LocalSourceNode nodeTo) {
372372
exists(StepSummary summary |
373-
StepSummary::step(nodeFrom, nodeTo, summary) and
374-
this = result.prepend(summary)
373+
StepSummary::step(pragma[only_bind_out](nodeFrom), nodeTo, pragma[only_bind_into](summary)) and
374+
this = result.prepend(pragma[only_bind_into](summary))
375375
)
376376
}
377377

0 commit comments

Comments
 (0)