mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user