llvm-project/libunwind
Alex Richardson 8df257a6d0 [libunwind] Ensure test/libunwind_01.pass is not completely inlined
By adding noinline and calling fprintf before returning we ensure that
every function will have a distinct call frame and that the return address
will always be saved instead of saving the target in main as the result.

Before this change all backtraces were always backtrace -> main -> _start,
i.e. always exactly three entries. This happenend because all calls were
inlined in main() and the test just happenend to pass because there is at
least _start before main.

I found this while fixing some bugs in libunwind for CHERI and noticed that
the test was passing even though the code was completely broken.

Obtained from: https://github.com/CTSRD-CHERI/llvm-project

Reviewed By: #libunwind, ldionne, MaskRay

Differential Revision: https://reviews.llvm.org/D126611
2022-06-20 09:05:49 +00:00
..
cmake [libunwind][CMake] Fix name of LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG 2022-05-27 09:20:57 +03:00
docs Replace links to archived mailing lists by links to Discourse forums 2022-03-23 10:10:20 -04:00
include [libunwind] Fix SEH unwinding on ARM 2022-06-06 23:23:35 +03:00
src [libunwind] Don't store a predecremented PC when using SEH 2022-06-06 23:25:24 +03:00
test [libunwind] Ensure test/libunwind_01.pass is not completely inlined 2022-06-20 09:05:49 +00:00
.clang-format
CMakeLists.txt [runtimes] Default LIB*_HERMETIC_STATIC_LIBRARY to ON on Windows 2022-05-18 20:31:51 +03:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00