[libc-commits] [libc] [libc][setjmp] remove naked fn attr (PR #112443)

James Y Knight via libc-commits libc-commits at lists.llvm.org
Tue Oct 15 15:38:09 PDT 2024


jyknight wrote:

This is unsafe. Without the naked attribute, the compiler could decide to emit a call-frame for this function, which would be totally broken. It might work today, under the compiler flag you tried with, but it is not guaranteed. I think llvm-libc should aspire not to depend on observed-but-not-guaranteed behaviors for correctness.

Additionally, the constraint string permits the compiler to allocate the addresses for the "m" constraints into registers which would be overwritten by the asm. So it's also unsafe due to that.



https://github.com/llvm/llvm-project/pull/112443


More information about the libc-commits mailing list