Skip to content

Commit 196d96c

Browse files
committed
Fix compiler check for stack unwind hint
The check inserts a DWARF directive to tell stack unwinding that the bottom of the (co-routine) stack has been reached. Without this, stack traces may attempt to continue past the bottom of the stack. The GCC version check was incorrect, and failed to trigger for GCC version 5.[0123].
1 parent 4f1ad43 commit 196d96c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mysys/my_context.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d)
206206
(
207207
"movq %%rsp, (%[save])\n\t"
208208
"movq %[stack], %%rsp\n\t"
209-
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 && !defined(__INTEL_COMPILER)
209+
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && !defined(__INTEL_COMPILER)
210210
/*
211211
This emits a DWARF DW_CFA_undefined directive to make the return address
212212
undefined. This indicates that this is the top of the stack frame, and
@@ -456,7 +456,7 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d)
456456
(
457457
"movl %%esp, (%[save])\n\t"
458458
"movl %[stack], %%esp\n\t"
459-
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 && !defined(__INTEL_COMPILER)
459+
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && !defined(__INTEL_COMPILER)
460460
/*
461461
This emits a DWARF DW_CFA_undefined directive to make the return address
462462
undefined. This indicates that this is the top of the stack frame, and

0 commit comments

Comments
 (0)