diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-08-13 10:11:36 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-08-13 10:11:36 +0900 |
| commit | 7907c184be2734e477511f9633e9b683cd8fe5b3 (patch) | |
| tree | cba95d00df8ed1f8b31142166b85360d3471fbda /mrbgems/mruby-compiler/core/codegen.c | |
| parent | 9c3d305530e6132d0e5292eef6dd939295135650 (diff) | |
| download | mruby-7907c184be2734e477511f9633e9b683cd8fe5b3.tar.gz mruby-7907c184be2734e477511f9633e9b683cd8fe5b3.zip | |
codegen.c: add a comment that notice `rewind_pc` calling convention.
`rewind_pc` should not be called when `s->pc` is `0` (top).
Diffstat (limited to 'mrbgems/mruby-compiler/core/codegen.c')
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 4 |
1 files 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 |
