mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Terminate float right shift if shift value is too big.
This commit is contained in:
@@ -484,6 +484,10 @@ flo_shift(mrb_state *mrb, mrb_value x, mrb_int width)
|
||||
if (width < 0) {
|
||||
while (width++) {
|
||||
val /= 2;
|
||||
if (val < 1.0) {
|
||||
val = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if defined(_ISOC99_SOURCE)
|
||||
val = trunc(val);
|
||||
|
||||
Reference in New Issue
Block a user