mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge revision(s) 0d89aedb734372bc35d8a569a992d13e86e7923e,a6f5f3cccda381ae332aaa6467f2644611371fb5,97cf290063ab940d08819cd96cbcca0ef6d50e4c: [Backport #17338]
Assign TAG_NONE to ruby_tag_type instead of 0 --- eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Also `eclass` loop can raise in `rb_obj_is_kind_of` --- eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Copy va_list of exception classes The list is reused when an exception raised again after retrying in the rescue procedure. --- eval.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
This commit is contained in:
parent
db21768950
commit
70e9489f9e
2 changed files with 9 additions and 5 deletions
12
eval.c
12
eval.c
|
@ -1021,7 +1021,7 @@ rb_vrescue2(VALUE (* b_proc) (VALUE), VALUE data1,
|
|||
else if (result) {
|
||||
/* escape from r_proc */
|
||||
if (state == TAG_RETRY) {
|
||||
state = 0;
|
||||
state = TAG_NONE;
|
||||
ec->errinfo = Qnil;
|
||||
result = Qfalse;
|
||||
goto retry_entry;
|
||||
|
@ -1033,17 +1033,21 @@ rb_vrescue2(VALUE (* b_proc) (VALUE), VALUE data1,
|
|||
if (state == TAG_RAISE) {
|
||||
int handle = FALSE;
|
||||
VALUE eclass;
|
||||
va_list ap;
|
||||
|
||||
while ((eclass = va_arg(args, VALUE)) != 0) {
|
||||
result = Qnil;
|
||||
/* 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) {
|
||||
result = Qnil;
|
||||
state = 0;
|
||||
state = TAG_NONE;
|
||||
if (r_proc) {
|
||||
result = (*r_proc) (data2, ec->errinfo);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
|
||||
#define RUBY_VERSION_TEENY 0
|
||||
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
|
||||
#define RUBY_PATCHLEVEL 48
|
||||
#define RUBY_PATCHLEVEL 49
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2021
|
||||
#define RUBY_RELEASE_MONTH 3
|
||||
|
|
Loading…
Add table
Reference in a new issue