diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-06 12:51:44 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-06 12:51:44 +0900 |
| commit | 2a52ebcc5627cac73cfe162a48a3964d285f321b (patch) | |
| tree | 5cdfe178a8c397047307231ba7b8ae61c5efd7ae /src | |
| parent | d93fc6593f3b057f2ec8b15eaabf83a29a5c3c72 (diff) | |
| download | mruby-2a52ebcc5627cac73cfe162a48a3964d285f321b.tar.gz mruby-2a52ebcc5627cac73cfe162a48a3964d285f321b.zip | |
Avoid negating `MRB_INT_MIN` which is impossible.
Diffstat (limited to 'src')
| -rw-r--r-- | src/numeric.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/numeric.c b/src/numeric.c index e1898301e..988342e88 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -646,6 +646,7 @@ flo_rshift(mrb_state *mrb, mrb_value x) mrb_int width; mrb_get_args(mrb, "i", &width); + if (width == MRB_INT_MIN) return flo_shift(mrb, x, -MRB_INT_BIT); return flo_shift(mrb, x, -width); } |
