File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -807,10 +807,25 @@ STATIC_OR_JS void NOINLINE JL_NORETURN start_task(void)
807
807
{
808
808
#ifdef _OS_WINDOWS_
809
809
#if defined(_CPU_X86_64_ )
810
- // install the unhandled exception hanlder at the top of our stack
810
+ // install the unhandled exception handler at the top of our stack
811
811
// to call directly into our personality handler
812
812
asm volatile ("\t.seh_handler __julia_personality, @except\n\t.text" );
813
813
#endif
814
+ #else
815
+ // wipe out the call-stack unwind capability beyond this function
816
+ // (we are noreturn, so it is not a total lie)
817
+ #if defined(_CPU_X86_64_ )
818
+ // per nongnu libunwind: "x86_64 ABI specifies that end of call-chain is marked with a NULL RBP or undefined return address"
819
+ // so we do all 3, to be extra certain of it
820
+ asm volatile ("\t.cfi_undefined rip" );
821
+ asm volatile ("\t.cfi_undefined rbp" );
822
+ asm volatile ("\t.cfi_return_column rbp" );
823
+ #else
824
+ // per nongnu libunwind: "DWARF spec says undefined return address location means end of stack"
825
+ // we use whatever happens to be register 1 on this platform for this
826
+ asm volatile ("\t.cfi_undefined 1" );
827
+ asm volatile ("\t.cfi_return_column 1" );
828
+ #endif
814
829
#endif
815
830
816
831
// this runs the first time we switch to a task
You can’t perform that action at this time.
0 commit comments