Skip to content

Commit 4ce8967

Browse files
authored
wasm2c: abort=>trap (#13718)
abort() would affect the entire outside program. Instead, trap, so the outside can handle it if it wants. We call this method on bad errors, but they are still bad errors inside the sandbox, so the outside can destroy the sandbox and forget about it.
1 parent 53e370a commit 4ce8967

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/wasm2c/base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ret (*name) params = _##name;
102102

103103
static void abort_with_message(const char* message) {
104104
fprintf(stderr, "%s\n", message);
105-
abort();
105+
TRAP(UNREACHABLE);
106106
}
107107

108108
// Maintain a stack of setjmps, each jump taking us back to the last invoke.

0 commit comments

Comments
 (0)