mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fixed integer overflow in lshift.
This commit is contained in:
+1
-1
@@ -1119,7 +1119,7 @@ lshift(mrb_state *mrb, mrb_int val, mrb_int width)
|
||||
}
|
||||
else {
|
||||
if ((width > NUMERIC_SHIFT_WIDTH_MAX) ||
|
||||
(val < (MRB_INT_MIN >> width))) {
|
||||
(val <= (MRB_INT_MIN >> width))) {
|
||||
#ifdef MRB_WITHOUT_FLOAT
|
||||
return mrb_fixnum_value(0);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user