-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
Support for functions using alloca has been added to the static analyzer so that dynamic stack allocations are now taken into account during stack usage analysis.
Details
Previously, the analyzer only handled fixed-size stack allocations. Functions relying on alloca (or equivalent IR instructions) were either ignored or underestimated in terms of stack usage.
With this change, alloca-based allocations are now detected and integrated into the stack usage computation, improving the accuracy of the analysis for functions that perform dynamic stack allocations.
Scope / Behavior
• Detect alloca instructions during analysis.
• Incorporate dynamically allocated stack size into the per-function stack usage calculation.
• Ensure functions using alloca are flagged/marked appropriately in the analysis output (if applicable).
Tasks
• Implement alloca handling in the static analysis core.
• Integrate alloca allocations into stack usage computation.
• Add or extend test cases covering functions that use alloca.
• Update documentation to mention alloca support and any limitations.
• Add a regression test to prevent future regressions on alloca handling.
Notes
If any edge cases appear (nested alloca, large dynamic allocations, interaction with recursion, etc.), they can be tracked in follow-up issues.