Debian Codegraph @

lldb/test/API/lang/BoundsSafety/soft_trap/mockSoftTrapRuntime.c

raw
1 #include <bounds_safety_soft_traps.h>
2 #include <ptrcheck.h>
3 #include <stdio.h>
4
5 #if __CLANG_BOUNDS_SAFETY_SOFT_TRAP_API_VERSION > 0
6 #error API version changed
7 #endif
8
9 // FIXME: The runtimes really shouldn't be built with `-fbounds-safety` in
10 // soft trap mode because of the risk of infinite recursion. However,
11 // there's currently no way to have source files built with different flags
12
13 void __bounds_safety_soft_trap_s(const char *reason) {
14 printf("BoundsSafety check FAILED: message:\"%s\"\n", reason ? reason : "");
15 }
16
17 void __bounds_safety_soft_trap(void) { printf("BoundsSafety check FAILED\n"); }