japaric / cargo-call-stack

Whole program static stack analysis
Apache License 2.0
579 stars 52 forks source link

Ignore LLVM's stack usage info when there's inline asm #51

Closed jonas-schievink closed 3 years ago

jonas-schievink commented 3 years ago

Fixes https://github.com/japaric/cargo-call-stack/issues/45

Instead of attempting to handle #[naked] specially, I just changed the code to ignore LLVM's stack usage info as soon as there's any inline assembly in a function. This should be more correct, since LLVM doesn't account for any stack pointer manipulation in inline assembly, but our thumb disassembler does (so the issue could manifest with any code that uses inline assembly).

japaric commented 3 years ago

Thanks!