We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e3e24e commit 3926373Copy full SHA for 3926373
wasm/longjmp/rt.c
@@ -84,6 +84,14 @@ __wasm_longjmp(void *env, int val)
84
{
85
struct state *state = &g_state;
86
struct arg *arg = &state->arg;
87
+ /*
88
+ * C standard:
89
+ * > The longjmp function cannot cause the setjmp macro to return
90
+ * > the value 0; if val is 0, the setjmp macro returns the value 1.
91
+ */
92
+ if (val == 0) {
93
+ val = 1;
94
+ }
95
arg->env = env;
96
arg->val = val;
97
__builtin_wasm_throw(1, arg);
0 commit comments