Skip to content

Commit 2e78230

Browse files
authored
set_exception_visitor: Remove the special case for wasi proc exit (#2525)
While wasi proc exit is not a real trap, what the runtime does on it is mostly same as real traps. That is, kill the siblings threads and represent the exit/trap as the result of the "process" to the user api. There seems no reason to distinguish it from real traps here. Note that: - The target thread either doesn't care the specific exception type or ignore wasi proc exit by themselves. (clear_wasi_proc_exit_exception) - clear_wasi_proc_exit_exception only clears local exception.
1 parent 8c2dc1d commit 2e78230

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

core/iwasm/libraries/thread-mgr/thread_manager.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,12 +1260,8 @@ set_exception_visitor(void *node, void *user_data)
12601260

12611261
exception_lock(wasm_inst);
12621262
if (data->exception != NULL) {
1263-
/* Only spread non "wasi proc exit" exception */
1264-
if (strcmp(data->exception, "wasi proc exit")) {
1265-
snprintf(wasm_inst->cur_exception,
1266-
sizeof(wasm_inst->cur_exception), "Exception: %s",
1267-
data->exception);
1268-
}
1263+
snprintf(wasm_inst->cur_exception, sizeof(wasm_inst->cur_exception),
1264+
"Exception: %s", data->exception);
12691265
}
12701266
else {
12711267
wasm_inst->cur_exception[0] = '\0';

0 commit comments

Comments
 (0)