[PATCH] D126343: [libunwind] Use process_vm_readv to avoid potential segfaults

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 24 23:23:36 PDT 2022


smeenai added inline comments.


================
Comment at: libunwind/test/bad_unwind_info.pass.cpp:70
+
+void bad_unwind_info();
+}
----------------
smeenai wrote:
> MaskRay wrote:
> > Use `__attribute__((naked))` with basic asm (https://gcc.gnu.org/onlinedocs/gcc/Basic-Asm.html), then get rid of the inline assembly language at file scope.
> I wanted to do this originally, but GCC doesn't support `__attribute__((naked))` on aarch64: https://godbolt.org/z/15rbv6GEG. I'm not sure if we need to support gcc in the test suite, but I thought at least libc++ tried to.
That being said, it looks like GCC isn't performing any stack manipulation in this case anyway, just adding a nop and a ret, which should be harmless. Not sure if we can rely on that in general though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126343/new/

https://reviews.llvm.org/D126343



More information about the llvm-commits mailing list