diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-08-13 10:10:17 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-08-13 10:10:17 +0900 |
| commit | 9c3d305530e6132d0e5292eef6dd939295135650 (patch) | |
| tree | e4125695a51fd27705e9119bcfa9da04d4262f24 /mrbgems/mruby-compiler/core/codegen.c | |
| parent | cbdc4f2c5c290173b17fd7b4cf23244f1acc39e1 (diff) | |
| download | mruby-9c3d305530e6132d0e5292eef6dd939295135650.tar.gz mruby-9c3d305530e6132d0e5292eef6dd939295135650.zip | |
codegen.c: refactor `mrb_last_insn()`.
Last commit made `mrb_decode_insn()` to take `NULL` as `pc`.
Diffstat (limited to 'mrbgems/mruby-compiler/core/codegen.c')
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index 1bac4e061..34b91b0cf 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -470,14 +470,7 @@ rewind_pc(codegen_scope *s) static struct mrb_insn_data mrb_last_insn(codegen_scope *s) { - const mrb_code *pc = mrb_prev_pc(s, pc_addr(s)); - if (pc == NULL) { - struct mrb_insn_data data; - - data.insn = OP_NOP; - return data; - } - return mrb_decode_insn(pc); + return mrb_decode_insn(mrb_prev_pc(s, pc_addr(s))); } static mrb_bool |
