mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Detect overflow in flo_shift().
This commit is contained in:
+3
-1
@@ -610,7 +610,9 @@ flo_shift(mrb_state *mrb, mrb_value x, mrb_int width)
|
||||
val *= 2;
|
||||
}
|
||||
}
|
||||
return mrb_int_value(mrb, (mrb_int)val);
|
||||
if (FIXABLE_FLOAT(val))
|
||||
return mrb_int_value(mrb, (mrb_int)val);
|
||||
return mrb_float_value(mrb, val);
|
||||
}
|
||||
|
||||
static mrb_value
|
||||
|
||||
Reference in New Issue
Block a user