diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-02-09 00:42:12 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-02-09 12:59:06 +0900 |
commit | 97cf290063ab940d08819cd96cbcca0ef6d50e4c (patch) | |
tree | 4b45739ea80690fddc9a94e13764b06d4ffcfc00 /eval.c | |
parent | a6f5f3cccda381ae332aaa6467f2644611371fb5 (diff) |
Copy va_list of exception classes
The list is reused when an exception raised again after retrying
in the rescue procedure.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4159
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1033,14 +1033,18 @@ rb_vrescue2(VALUE (* b_proc) (VALUE), VALUE data1, if (state == TAG_RAISE) { int handle = FALSE; VALUE eclass; + va_list ap; result = Qnil; - while ((eclass = va_arg(args, VALUE)) != 0) { + /* reuses args when raised again after retrying in r_proc */ + va_copy(ap, args); + while ((eclass = va_arg(ap, VALUE)) != 0) { if (rb_obj_is_kind_of(ec->errinfo, eclass)) { handle = TRUE; break; } } + va_end(ap); if (handle) { state = TAG_NONE; |