From b151a697e09b2088db3d1f86f355f32fb60f9691 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 2 Jan 2021 13:22:55 +0900 Subject: Fixed wrong casting in `OP_LOADI32`. Negative integer `>-65535` had wrong value, e,g, `p(-40550)` printed `4294926746` since Nov. 2020, sigh. --- src/codedump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/codedump.c') diff --git a/src/codedump.c b/src/codedump.c index 576ff6ceb..b005c1173 100644 --- a/src/codedump.c +++ b/src/codedump.c @@ -172,7 +172,7 @@ codedump(mrb_state *mrb, const mrb_irep *irep) print_lv_a(mrb, irep, a); break; CASE(OP_LOADI32, BSS); - printf("OP_LOADI32\tR%d\t%d\t", a, (int)(((uint32_t)b<<16)+c)); + printf("OP_LOADI32\tR%d\t%d\t", a, (int32_t)(((uint32_t)b<<16)+c)); print_lv_a(mrb, irep, a); break; CASE(OP_LOADI__1, B); -- cgit v1.2.3