summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mrbgems/mruby-compiler/core/codegen.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c
index 4dfe07faf..9915440dd 100644
--- a/mrbgems/mruby-compiler/core/codegen.c
+++ b/mrbgems/mruby-compiler/core/codegen.c
@@ -791,6 +791,7 @@ gen_muldiv(codegen_scope *s, uint8_t op, uint16_t dst)
if (mrb_int_mul_overflow(n0, n, &n)) goto normal;
}
else { /* OP_DIV */
+ if (n0 == MRB_INT_MIN && n == -1) goto normal;
n = n0 / n;
}
s->pc = addr_pc(s, data0.addr);