diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-08-30 01:23:17 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-08-30 01:23:17 +0900 |
| commit | 75a01af710309e4fc53db285c9018e233c61cb56 (patch) | |
| tree | 88709c9e8922996c4d2ca0be1c3a191f72a1f066 | |
| parent | 5addd5db4a59450427abae2e9925c529fd6868a1 (diff) | |
| download | mruby-75a01af710309e4fc53db285c9018e233c61cb56.tar.gz mruby-75a01af710309e4fc53db285c9018e233c61cb56.zip | |
Remove consequent `OP_RETURN` by peephole optimization.
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index 0d47b236d..835cee817 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -461,7 +461,7 @@ gen_return(codegen_scope *s, uint8_t op, uint16_t src) s->pc = s->lastpc; genop_1(s, op, data.b); } - else { + else if (data.insn != OP_RETURN) { genop_1(s, op, src); } } |
