-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support inlining of callees during decompilation #4595
Conversation
7665311
to
224858c
Compare
Usage example, compiled as a .so with -O1: Source:
Results in:
Or inline them all:
|
Not sure why @ltfish interested in your advice on https://github.com/angr/angr/pull/4595/files#diff-adef200972def43293b03d09ffab132238dc517eebb0d69250ddd3e5a5a31e91R339 . This is where I remove calls and their windups, but I'm hardcoding the cases here. |
Did you commit the |
Yep, with the branch named the same. Not sure why that's not being picked up either. |
@zardus Just push to master. PRs no longer pick up branches from other repos with the same name. |
1e661ef
to
f242d6a
Compare
@zardus have you tested with Python 3.8 (that's the version running in CI IIRC)? |
520ac58
to
a7f4583
Compare
rename functions_callable to functions_reachable
…r. This happens when doing inlined decompilation
… for inlining functions onto stacks of other functions
a16a0a6
to
1a1b5b2
Compare
for more information, see https://pre-commit.ci
Noooo @zardus officially beat me. |
It be like that sometimes |
Traditionally, we decompile a function at a time, but this can be annoying with:
This PR adds support to angr to inline functions during decompilation, subjecting the resulting super-function to our optimizations (such as constant propagation that can eliminate portions of inlined functions). The functionality is enabled by passing an
inline_functions
of Function objects (current FIXME: it just checks addresses) to Decompiler (which passes it on to Clinic).TODOs:
inline_functions
consistent with its type annotationcallsite_maker
hackiness is still needed now that we're more careful about optimizationsThe core inlining code is based on original exploration by @mrT4ntr4 (which doesn't apply cleanly to modern Clinic, otherwise I'd included the commits to preserve history) --- thanks, Suraj!