-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathprettifysegfaultnoinline.cpp
More file actions
51 lines (44 loc) · 1.02 KB
/
prettifysegfaultnoinline.cpp
File metadata and controls
51 lines (44 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <stdexcept>
void throw_catchable_segfault_exception();
void throw_catchable_segfault_exception2();
void throw_catchable_segfault_exception3();
void throw_catchable_segfault_exception4();
void throw_catchable_segfault_exception5();
// Placing a function in a different compilation unit usually prevents inlining
void throw_catchable_segfault_exception_noinline()
{
throw_catchable_segfault_exception();
}
void throw_catchable_segfault_exception2_noinline()
{
// try/catch needed here to prevent inlining in 32-bit builds on 64-bit windows (WOW64)
try {
throw_catchable_segfault_exception2();
} catch(...) {
throw;
}
}
void throw_catchable_segfault_exception3_noinline()
{
try {
throw_catchable_segfault_exception3();
} catch(...) {
throw;
}
}
void throw_catchable_segfault_exception4_noinline()
{
try {
throw_catchable_segfault_exception4();
} catch(...) {
throw;
}
}
void throw_catchable_segfault_exception5_noinline()
{
try {
throw_catchable_segfault_exception5();
} catch(...) {
throw;
}
}