mruby-bigint: add explicit cast to mp_limb for range-checked values

add explicit cast when assigning mrb_int to mp_limb. the value is
already validated to fit within mp_limb range by checking against
DIG_BASE, but explicit cast silences msvc warning c4244.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-10-16 17:06:31 +09:00
parent e8bcfa71c3
commit 0c849e9020
+2 -2
View File
@@ -3466,10 +3466,10 @@ mrb_bint_xor(mrb_state *mrb, mrb_value x, mrb_value y)
mpz_init_set(ctx, &c, &a);
if (a.sz == 0) {
mpz_realloc(ctx, &c, 1);
c.p[0] = z;
c.p[0] = (mp_limb)z;
}
else {
c.p[0] ^= z;
c.p[0] ^= (mp_limb)z;
}
return bint_norm(mrb, bint_new(ctx, &c));
}