mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
codegen.c: avoid integer overflow.
This commit is contained in:
@@ -1128,6 +1128,7 @@ gen_uniop(codegen_scope *s, mrb_sym sym, uint16_t dst)
|
||||
/* unary plus does nothing */
|
||||
}
|
||||
else if (sym == MRB_OPSYM_2(s->mrb, minus)) {
|
||||
if (n == MRB_INT_MIN) return FALSE;
|
||||
n = -n;
|
||||
}
|
||||
else if (sym == MRB_OPSYM_2(s->mrb, neg)) {
|
||||
|
||||
Reference in New Issue
Block a user