mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Python: Prevent joining on scope in PointsToContext::appliesTo
One of those cases where I _wish_ `pragma[inline]` also meant "don't join on the stuff inside this predicate -- it's inlined for a reason". Unsurprisingly, joining on the scope first works poorly.
This commit is contained in:
@@ -184,7 +184,11 @@ class PointsToContext extends TPointsToContext {
|
||||
|
||||
/** Holds if this context can apply to the CFG node `n`. */
|
||||
pragma[inline]
|
||||
predicate appliesTo(ControlFlowNode n) { this.appliesToScope(n.getScope()) }
|
||||
predicate appliesTo(ControlFlowNode n) {
|
||||
exists(Scope s |
|
||||
this.appliesToScope(pragma[only_bind_into](s)) and pragma[only_bind_into](s) = n.getScope()
|
||||
)
|
||||
}
|
||||
|
||||
/** Holds if this context is a call context. */
|
||||
predicate isCall() { this = TCallContext(_, _, _) }
|
||||
|
||||
Reference in New Issue
Block a user