Skip to content

Commit 2401797

Browse files
committed
Merge branch 'master' into dist/4.0/trixie
2 parents 57e1b87 + 26538df commit 2401797

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2192
-18062
lines changed

ChangeLog

Lines changed: 228 additions & 17465 deletions
Large diffs are not rendered by default.

bignum.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7070,7 +7070,7 @@ int_pow_tmp3(VALUE x, VALUE y, VALUE m, int nega_flg)
70707070
zn = mn;
70717071
z = bignew(zn, 1);
70727072
bary_powm_gmp(BDIGITS(z), zn, BDIGITS(x), xn, BDIGITS(y), yn, BDIGITS(m), mn);
7073-
if (nega_flg & BIGNUM_POSITIVE_P(z)) {
7073+
if (nega_flg && BIGNUM_POSITIVE_P(z) && !BIGZEROP(z)) {
70747074
z = rb_big_minus(z, m);
70757075
}
70767076
RB_GC_GUARD(x);
@@ -7098,7 +7098,7 @@ int_pow_tmp3(VALUE x, VALUE y, VALUE m, int nega_flg)
70987098
x = rb_int_modulo(x, m);
70997099
}
71007100

7101-
if (nega_flg && rb_int_positive_p(tmp)) {
7101+
if (nega_flg && rb_int_positive_p(tmp) && !rb_int_zero_p(tmp)) {
71027102
tmp = rb_int_minus(tmp, m);
71037103
}
71047104
return tmp;
@@ -7210,6 +7210,11 @@ rb_int_powm(int const argc, VALUE * const argv, VALUE const num)
72107210
rb_raise(rb_eTypeError, "Integer#pow() 2nd argument not allowed unless all arguments are integers");
72117211
}
72127212

7213+
if (rb_int_zero_p(a) && !rb_int_zero_p(b)) {
7214+
/* shortcut; 0**x => 0 except for x == 0 */
7215+
return INT2FIX(0);
7216+
}
7217+
72137218
if (rb_int_negative_p(m)) {
72147219
m = rb_int_uminus(m);
72157220
nega_flg = 1;

class.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ rb_class_duplicate_classext(rb_classext_t *orig, VALUE klass, const rb_box_t *bo
491491
while (subclass_entry) {
492492
if (subclass_entry->klass && RB_TYPE_P(subclass_entry->klass, T_ICLASS)) {
493493
iclass = subclass_entry->klass;
494+
VM_ASSERT(RB_TYPE_P(iclass, T_ICLASS));
494495
if (RBASIC_CLASS(iclass) == klass) {
495496
// Is the subclass an ICLASS including this module into another class
496497
// If so we need to re-associate it under our box with the new ext
@@ -819,7 +820,8 @@ class_alloc0(enum ruby_value_type type, VALUE klass, bool boxable)
819820
static VALUE
820821
class_alloc(enum ruby_value_type type, VALUE klass)
821822
{
822-
return class_alloc0(type, klass, false);
823+
bool boxable = rb_box_available() && BOX_ROOT_P(rb_current_box());
824+
return class_alloc0(type, klass, boxable);
823825
}
824826

825827
static VALUE

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
ruby4.0 (4.0.1-0nkmi1~dist) unstable; urgency=medium
2+
3+
* 4.0.1
4+
5+
-- Sorah Fukumori <her@sorah.jp> Wed, 14 Jan 2026 08:59:19 +0900
6+
17
ruby4.0 (4.0.0-0nkmi1~dist) unstable; urgency=medium
28

39
* Ruby 4.0!

0 commit comments

Comments
 (0)