Repository navigation
feat: closure bodies - #61
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First point of the consolidation: the bodies of nested functions and lambdas.
test: define closure bodies, captured parameters and factory routes), implementation follows.defand everylambdainside an analysable function is an analysable function of its own, named after its enclosing functions (outer.inner,outer.lambda_L_C); a lambda is synthesized as a function returning its body. Coverage counts them, plugins see them, and--emit-irprints them.MakeFunctioncarries the captured values at the definition point, and the call graph maps a call to a nested function to a known function, so summaries and taint map the callee's captured parameters onto those values: a sink inside a closure is reached through the call, reported at the call site withthrough, like a call to any helper. A closure that is never called stays silent.nonlocalassignments remain unsupported.app = Flask(__name__)increate_app, then@app.routeon a nested function) resolve through the enclosing function's locals, so they are entry points.On the sixteen repositories nothing changes: none of them keeps a sink inside a callback, which is what the manual reading had suggested and why this came second.