Repository navigation
Commit 9aaf1a2
committed
throw.h: use setjmp/longjmp with clang on MinGW
The MinGW branch picks __builtin_setjmp/__builtin_longjmp for any
compiler that defines __GNUC__ >= 4, and clang does. Clang declares
__builtin_setjmp as taking a void **, while jmp_buf on mingw-w64 is an
array of struct _SETJMP_FLOAT128, so llvm-mingw (clang 23) stops at the
first MRB_TRY/MRC_TRY with -Wincompatible-pointer-types, which is an
error there:
codegen.c:221:3: error: incompatible pointer types passing
'jmp_buf' (aka 'struct _SETJMP_FLOAT128[16]') to parameter of type
'void **'
Casting the buffer to void ** gets the build through, but then the
first exception crashes: `begin; raise "x"; rescue; end` segfaults and
mrbtest dies before its first test, as #5950 reported. Leave clang out
of the builtin branch, as was done for ARM64 in #6637, so it uses the
setjmp()/longjmp() from <setjmp.h>. GCC keeps the builtins. The same
condition is in mrc_throw.h.1 parent d474475 commit 9aaf1a2
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
0 commit comments