summaryrefslogtreecommitdiffhomepage
path: root/src/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/numeric.c')
-rw-r--r--src/numeric.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/numeric.c b/src/numeric.c
index 2117fcc3c..b4b85a9c6 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -995,6 +995,7 @@ fix_lshift(mrb_state *mrb, mrb_value x)
return x;
}
val = mrb_fixnum(x);
+ if (val == 0) return x;
if (width < 0) {
return rshift(val, -width);
}
@@ -1019,6 +1020,7 @@ fix_rshift(mrb_state *mrb, mrb_value x)
return x;
}
val = mrb_fixnum(x);
+ if (val == 0) return x;
if (width < 0) {
return lshift(mrb, val, -width);
}