mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Skip too big left shift in flo_shift().
This commit is contained in:
@@ -611,6 +611,10 @@ flo_shift(mrb_state *mrb, mrb_value x, mrb_int width)
|
||||
return x;
|
||||
}
|
||||
val = mrb_float(x);
|
||||
if (width < -MRB_INT_BIT/2) {
|
||||
if (val < 0) return mrb_fixnum_value(-1);
|
||||
return mrb_fixnum_value(0);
|
||||
}
|
||||
if (width < 0) {
|
||||
while (width++) {
|
||||
val /= 2;
|
||||
|
||||
Reference in New Issue
Block a user