mruby-rational (int_lshift): add cast to stop overflow warning

This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-10-11 08:44:12 +09:00
parent f4fdf25bb0
commit 763c9cba03
+1 -1
View File
@@ -326,7 +326,7 @@ int_lshift(mrb_state *mrb, mrb_value v, mrb_int n)
if (mrb_integer_p(v)) {
uint64_t u = (uint64_t)mrb_integer(v);
if (mrb_int_fit_p(u << n, uint64_t))
return mrb_int_value(mrb, u << n);
return mrb_int_value(mrb, (mrb_int)(u << n));
}
#ifndef RAT_BIGINT
rat_overflow(mrb);