From 26169f9e25788caf2781a92087f489e5e5fdc0c9 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 11 Mar 2017 16:32:29 +0900 Subject: Enhance OP_RESCUE to take B operand fas matching exception; ref #3487 --- src/codedump.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/codedump.c') diff --git a/src/codedump.c b/src/codedump.c index 59ba4fdae..c20afdd00 100644 --- a/src/codedump.c +++ b/src/codedump.c @@ -408,8 +408,22 @@ codedump(mrb_state *mrb, mrb_irep *irep) printf("OP_ONERR\t%03d\n", i+GETARG_sBx(c)); break; case OP_RESCUE: - printf("OP_RESCUE\tR%d\t\t", GETARG_A(c)); - print_lv(mrb, irep, c, RA); + { + int a = GETARG_A(c); + int b = GETARG_B(c); + int cnt = GETARG_C(c); + + if (b == 0) { + printf("OP_RESCUE\tR%d\t\t%s", a, cnt ? "cont" : ""); + print_lv(mrb, irep, c, RA); + break; + } + else { + printf("OP_RESCUE\tR%d\tR%d\t%s", a, b, cnt ? "cont" : ""); + print_lv(mrb, irep, c, RAB); + break; + } + } break; case OP_RAISE: printf("OP_RAISE\tR%d\t\t", GETARG_A(c)); -- cgit v1.2.3