[PATCH] D114385: [libunwind] Fix testing with sanitizers enabled

Louis Dionne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 02:44:54 PST 2021


ldionne added inline comments.


================
Comment at: libunwind/test/unwind_leaffunction.pass.cpp:41-43
 __attribute__((noinline)) void crashing_leaf_func(void) {
-  *faultyPointer = 0;
+  raise(SIGSEGV);
 }
----------------
danielkiss wrote:
> adding a call here turns the leaf function into a not-leaf function which changes the intention of this test.
> 
Ugh, that's a good point. I'm not sure how to trigger `SIGSEGV` without invoking a function nor invoking undefined behavior. Do you have a suggestion?

Would using `__builtin_trap()` do any kind of good?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114385



More information about the llvm-commits mailing list