summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/fuzz_opt.py3
-rw-r--r--src/tools/wasm2c-wrapper.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py
index eedb00d73..145a2c543 100755
--- a/scripts/fuzz_opt.py
+++ b/scripts/fuzz_opt.py
@@ -406,6 +406,9 @@ class CompareVMs(TestCaseHandler):
run([in_bin('wasm-opt'), wasm, '--emit-wasm2c-wrapper=main.c'] + FEATURE_OPTS)
run(['wasm2c', wasm, '-o', 'wasm.c'])
compile_cmd = ['emcc', 'main.c', 'wasm.c', os.path.join(self.wasm2c_dir, 'wasm-rt-impl.c'), '-I' + self.wasm2c_dir, '-lm']
+ # disable the signal handler: emcc looks like unix, but wasm has
+ # no signals
+ compile_cmd += ['-DWASM_RT_MEMCHECK_SIGNAL_HANDLER=0']
if random.random() < 0.5:
compile_cmd += ['-O' + str(random.randint(1, 3))]
elif random.random() < 0.5:
diff --git a/src/tools/wasm2c-wrapper.h b/src/tools/wasm2c-wrapper.h
index fb0658ef0..55eed0c35 100644
--- a/src/tools/wasm2c-wrapper.h
+++ b/src/tools/wasm2c-wrapper.h
@@ -89,7 +89,7 @@ int main(int argc, char** argv) {
(*Z_hangLimitInitializerZ_vv)();
// Prepare to call the export, so we can catch traps.
- if (setjmp(g_jmp_buf) != 0) {
+ if (WASM_RT_SETJMP(g_jmp_buf) != 0) {
puts("exception!");
} else {
// Call the proper export.