Fixed integer overflow in `lshift`.

parent 7dae0ec7
...@@ -1119,7 +1119,7 @@ lshift(mrb_state *mrb, mrb_int val, mrb_int width) ...@@ -1119,7 +1119,7 @@ lshift(mrb_state *mrb, mrb_int val, mrb_int width)
} }
else { else {
if ((width > NUMERIC_SHIFT_WIDTH_MAX) || if ((width > NUMERIC_SHIFT_WIDTH_MAX) ||
(val < (MRB_INT_MIN >> width))) { (val <= (MRB_INT_MIN >> width))) {
#ifdef MRB_WITHOUT_FLOAT #ifdef MRB_WITHOUT_FLOAT
return mrb_fixnum_value(0); return mrb_fixnum_value(0);
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment