From 7907c184be2734e477511f9633e9b683cd8fe5b3 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 13 Aug 2021 10:11:36 +0900 Subject: codegen.c: add a comment that notice `rewind_pc` calling convention. `rewind_pc` should not be called when `s->pc` is `0` (top). --- mrbgems/mruby-compiler/core/codegen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index 34b91b0cf..8ece1a0fb 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -463,8 +463,8 @@ mrb_prev_pc(codegen_scope *s, const mrb_code *pc) static void rewind_pc(codegen_scope *s) { - const mrb_code *pc = mrb_prev_pc(s, pc_addr(s)); - s->pc = addr_pc(s, pc); + /* should not be called when s->pc is 0 (top) */ + s->pc = addr_pc(s, mrb_prev_pc(s, pc_addr(s))); } static struct mrb_insn_data -- cgit v1.2.3