|
Line 0
Link Here
|
|
|
1 |
--- mysys/stacktrace.c.orig 2018-01-18 17:10:31 UTC |
| 2 |
+++ mysys/stacktrace.c |
| 3 |
@@ -34,19 +34,19 @@ |
| 4 |
#include <execinfo.h> |
| 5 |
#endif |
| 6 |
|
| 7 |
+#ifdef __linux__ |
| 8 |
#define PTR_SANE(p) ((p) && (char*)(p) >= heap_start && (char*)(p) <= heap_end) |
| 9 |
- |
| 10 |
static char *heap_start; |
| 11 |
- |
| 12 |
-#ifdef HAVE_BSS_START |
| 13 |
extern char *__bss_start; |
| 14 |
-#endif |
| 15 |
+#else |
| 16 |
+#define PTR_SANE(p) (p) |
| 17 |
+#endif /* __linux */ |
| 18 |
|
| 19 |
void my_init_stacktrace() |
| 20 |
{ |
| 21 |
-#ifdef HAVE_BSS_START |
| 22 |
+#ifdef __linux__ |
| 23 |
heap_start = (char*) &__bss_start; |
| 24 |
-#endif |
| 25 |
+#endif /* __linux__ */ |
| 26 |
} |
| 27 |
|
| 28 |
#ifdef __linux__ |
| 29 |
@@ -131,14 +131,14 @@ static int safe_print_str(const char *ad |
| 30 |
|
| 31 |
void my_safe_print_str(const char* val, int max_len) |
| 32 |
{ |
| 33 |
+#ifdef __linux__ |
| 34 |
char *heap_end; |
| 35 |
|
| 36 |
-#ifdef __linux__ |
| 37 |
if (!safe_print_str(val, max_len)) |
| 38 |
return; |
| 39 |
-#endif |
| 40 |
|
| 41 |
heap_end= (char*) sbrk(0); |
| 42 |
+#endif |
| 43 |
|
| 44 |
if (!PTR_SANE(val)) |
| 45 |
{ |