summaryrefslogtreecommitdiff
path: root/wasm
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-08-06 13:32:27 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-08-08 08:34:53 +0900
commit1a83474ded0b3ed90549c4c6e43e0b3e9ab09851 (patch)
treec7a977339381a2a14806e55365a065e19cb28e07 /wasm
parent89dbca894f677f7c6de1b648ad93d88548f22887 (diff)
Simplify try-rescue loop
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8182
Diffstat (limited to 'wasm')
-rw-r--r--wasm/setjmp.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/wasm/setjmp.c b/wasm/setjmp.c
index 0663b57300..198d210bbf 100644
--- a/wasm/setjmp.c
+++ b/wasm/setjmp.c
@@ -165,9 +165,9 @@ rb_wasm_try_catch_loop_run(struct rb_wasm_try_catch *try_catch, rb_wasm_jmp_buf
break;
}
- while (1) {
+ {
// catch longjmp with target jmp_buf
- if (rb_asyncify_unwind_buf && _rb_wasm_active_jmpbuf == target) {
+ while (rb_asyncify_unwind_buf && _rb_wasm_active_jmpbuf == target) {
// do similar steps setjmp does when JMP_BUF_STATE_RETURNING
// stop unwinding
@@ -182,14 +182,9 @@ rb_wasm_try_catch_loop_run(struct rb_wasm_try_catch *try_catch, rb_wasm_jmp_buf
if (try_catch->catch_f) {
try_catch->catch_f(try_catch->context);
}
- continue;
- } else if (rb_asyncify_unwind_buf /* unrelated unwind */) {
- return;
}
- // no unwind, then exit
- break;
+ // no unwind or unrelated unwind, then exit
}
- return;
}
void *