diff options
author | Nobuyoshi Nakada <[email protected]> | 2025-01-02 15:50:20 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2025-01-02 15:50:20 +0900 |
commit | 8034e9c3d001ca3dff124ab42972684eac8af2ae (patch) | |
tree | 07d9f6de5837fe14973e73cf24deda966f913cd5 /io.c | |
parent | 6cf11ad76eae08ba9d2bdc70c093bc67aca93864 (diff) |
[Bug #20995] Protect `IO.popen` block from exiting by exception
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12497
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -8038,7 +8038,7 @@ popen_finish(VALUE port, VALUE klass) if (NIL_P(port)) { /* child */ if (rb_block_given_p()) { - rb_yield(Qnil); + rb_protect(rb_yield, Qnil, NULL); rb_io_flush(rb_ractor_stdout()); rb_io_flush(rb_ractor_stderr()); _exit(0); |