MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / OnStackUnwind

Function OnStackUnwind

system/lib/compiler-rt/lib/asan/asan_errors.cpp:25–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace __asan {
24
25static void OnStackUnwind(const SignalContext &sig,
26 const void *callback_context,
27 BufferedStackTrace *stack) {
28 bool fast = common_flags()->fast_unwind_on_fatal;
29#if SANITIZER_FREEBSD || SANITIZER_NETBSD
30 // On FreeBSD the slow unwinding that leverages _Unwind_Backtrace()
31 // yields the call stack of the signal's handler and not of the code
32 // that raised the signal (as it does on Linux).
33 fast = true;
34#endif
35 // Tests and maybe some users expect that scariness is going to be printed
36 // just before the stack. As only asan has scariness score we have no
37 // corresponding code in the sanitizer_common and we use this callback to
38 // print it.
39 static_cast<const ScarinessScoreBase *>(callback_context)->Print();
40 stack->Unwind(StackTrace::GetNextInstructionPc(sig.pc), sig.bp, sig.context,
41 fast);
42}
43
44void ErrorDeadlySignal::Print() {
45 ReportDeadlySignal(signal, tid, &OnStackUnwind, &scariness);

Callers

nothing calls this directly

Calls 3

common_flagsFunction · 0.85
PrintMethod · 0.45
UnwindMethod · 0.45

Tested by

no test coverage detected