mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
codegen.c: avoid division by zero in constant folding.
This commit is contained in:
@@ -784,7 +784,7 @@ gen_muldiv(codegen_scope *s, uint8_t op, uint16_t dst)
|
||||
goto normal;
|
||||
}
|
||||
struct mrb_insn_data data0 = mrb_decode_insn(mrb_prev_pc(s, data.addr));
|
||||
if (!get_int_operand(s, &data0, &n0)) {
|
||||
if (!get_int_operand(s, &data0, &n0) || n == 0) {
|
||||
goto normal;
|
||||
}
|
||||
if (op == OP_MUL) {
|
||||
|
||||
Reference in New Issue
Block a user