summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-08-30 01:23:17 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-08-30 01:23:17 +0900
commit75a01af710309e4fc53db285c9018e233c61cb56 (patch)
tree88709c9e8922996c4d2ca0be1c3a191f72a1f066 /mrbgems
parent5addd5db4a59450427abae2e9925c529fd6868a1 (diff)
downloadmruby-75a01af710309e4fc53db285c9018e233c61cb56.tar.gz
mruby-75a01af710309e4fc53db285c9018e233c61cb56.zip
Remove consequent `OP_RETURN` by peephole optimization.
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/mruby-compiler/core/codegen.c2
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);
}
}