Skip to content

Commit 4506f3e

Browse files
committed
Merge branch 'master-2.5' into dist/2.5/stretch
2 parents a1dfdb1 + b9d3561 commit 4506f3e

File tree

97 files changed

+2823
-1033
lines changed

Some content is hidden

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

97 files changed

+2823
-1033
lines changed

ChangeLog

Lines changed: 647 additions & 2 deletions
Large diffs are not rendered by default.

array.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3241,6 +3241,7 @@ static VALUE
32413241
rb_ary_reject_bang(VALUE ary)
32423242
{
32433243
RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
3244+
rb_ary_modify(ary);
32443245
return ary_reject_bang(ary);
32453246
}
32463247

bootstraptest/test_literal.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,24 @@
223223
:ok
224224
}
225225

226+
assert_equal 'ok', %q{ # Bug #15536
227+
eval <<-END
228+
{
229+
**{
230+
a0: nil, a1: nil, a2: nil, a3: nil, a4: nil, a5: nil, a6: nil, a7: nil, a8: nil,
231+
},
232+
a0: nil, a1: nil, a2: nil, a3: nil, a4: nil, a5: nil, a6: nil, a7: nil, a8: nil,
233+
**{
234+
c: nil
235+
},
236+
b0: nil, b1: nil, b2: nil, b3: nil, b4: nil, b5: nil, b6: nil, b7: nil, b8: nil,
237+
b9: nil, b10: nil, b11: nil, b12: nil, b13: nil, b14: nil, b15: nil, b16: nil,
238+
b17: nil, b18: nil, b19: nil, b20: nil, b21: nil,
239+
}
240+
END
241+
:ok
242+
}
243+
226244
assert_equal 'ok', %q{
227245
[print(:ok), exit] # void literal with side-effect
228246
:dummy

compile.c

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,7 +2651,7 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
26512651
}
26522652
else if (!iseq_pop_newarray(iseq, pobj)) {
26532653
pobj = new_insn_core(iseq, pobj->insn_info.line_no, BIN(pop), 0, NULL);
2654-
ELEM_INSERT_NEXT(&iobj->link, &pobj->link);
2654+
ELEM_INSERT_PREV(&iobj->link, &pobj->link);
26552655
}
26562656
if (cond) {
26572657
if (prev_dup) {
@@ -4580,6 +4580,7 @@ compile_if(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int
45804580
DECL_ANCHOR(else_seq);
45814581
LABEL *then_label, *else_label, *end_label;
45824582
VALUE branches = 0;
4583+
int ci_size, ci_kw_size;
45834584

45844585
INIT_ANCHOR(cond_seq);
45854586
INIT_ANCHOR(then_seq);
@@ -4590,8 +4591,22 @@ compile_if(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int
45904591

45914592
compile_branch_condition(iseq, cond_seq, node->nd_cond,
45924593
then_label, else_label);
4594+
4595+
ci_size = iseq->body->ci_size;
4596+
ci_kw_size = iseq->body->ci_kw_size;
45934597
CHECK(COMPILE_(then_seq, "then", node_body, popped));
4598+
if (!then_label->refcnt) {
4599+
iseq->body->ci_size = ci_size;
4600+
iseq->body->ci_kw_size = ci_kw_size;
4601+
}
4602+
4603+
ci_size = iseq->body->ci_size;
4604+
ci_kw_size = iseq->body->ci_kw_size;
45944605
CHECK(COMPILE_(else_seq, "else", node_else, popped));
4606+
if (!else_label->refcnt) {
4607+
iseq->body->ci_size = ci_size;
4608+
iseq->body->ci_kw_size = ci_kw_size;
4609+
}
45954610

45964611
ADD_SEQ(ret, cond_seq);
45974612

@@ -8635,7 +8650,15 @@ ibf_load_iseq_each(const struct ibf_load *load, rb_iseq_t *iseq, ibf_offset_t of
86358650
rb_raise(rb_eRuntimeError, "path object size mismatch");
86368651
}
86378652
path = rb_fstring(RARRAY_AREF(pathobj, 0));
8638-
realpath = rb_fstring(RARRAY_AREF(pathobj, 1));
8653+
realpath = RARRAY_AREF(pathobj, 1);
8654+
if (!NIL_P(realpath)) {
8655+
if (!RB_TYPE_P(realpath, T_STRING)) {
8656+
rb_raise(rb_eArgError, "unexpected realpath %"PRIxVALUE
8657+
"(%x), path=%+"PRIsVALUE,
8658+
realpath, TYPE(realpath), path);
8659+
}
8660+
realpath = rb_fstring(realpath);
8661+
}
86398662
}
86408663
else {
86418664
rb_raise(rb_eRuntimeError, "unexpected path object");
@@ -8899,9 +8922,9 @@ static void
88998922
ibf_dump_object_regexp(struct ibf_dump *dump, VALUE obj)
89008923
{
89018924
struct ibf_object_regexp regexp;
8902-
regexp.srcstr = RREGEXP_SRC(obj);
8925+
VALUE srcstr = RREGEXP_SRC(obj);
89038926
regexp.option = (char)rb_reg_options(obj);
8904-
regexp.srcstr = (long)ibf_dump_object(dump, regexp.srcstr);
8927+
regexp.srcstr = (long)ibf_dump_object(dump, srcstr);
89058928
IBF_WV(regexp);
89068929
}
89078930

@@ -9328,7 +9351,7 @@ ibf_dump_setup(struct ibf_dump *dump, VALUE dumper_obj)
93289351
}
93299352

93309353
VALUE
9331-
iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt)
9354+
rb_iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt)
93329355
{
93339356
struct ibf_dump *dump;
93349357
struct ibf_header header = {{0}};
@@ -9387,7 +9410,7 @@ ibf_iseq_list(const struct ibf_load *load)
93879410
}
93889411

93899412
void
9390-
ibf_load_iseq_complete(rb_iseq_t *iseq)
9413+
rb_ibf_load_iseq_complete(rb_iseq_t *iseq)
93919414
{
93929415
struct ibf_load *load = RTYPEDDATA_DATA(iseq->aux.loader.obj);
93939416
rb_iseq_t *prev_src_iseq = load->iseq;
@@ -9402,7 +9425,7 @@ ibf_load_iseq_complete(rb_iseq_t *iseq)
94029425
const rb_iseq_t *
94039426
rb_iseq_complete(const rb_iseq_t *iseq)
94049427
{
9405-
ibf_load_iseq_complete((rb_iseq_t *)iseq);
9428+
rb_ibf_load_iseq_complete((rb_iseq_t *)iseq);
94069429
return iseq;
94079430
}
94089431
#endif
@@ -9429,7 +9452,7 @@ ibf_load_iseq(const struct ibf_load *load, const rb_iseq_t *index_iseq)
94299452
rb_ary_store(load->iseq_list, iseq_index, (VALUE)iseq);
94309453

94319454
#if !USE_LAZY_LOAD
9432-
ibf_load_iseq_complete(iseq);
9455+
rb_ibf_load_iseq_complete(iseq);
94339456
#endif /* !USE_LAZY_LOAD */
94349457

94359458
if (load->iseq) {
@@ -9504,23 +9527,23 @@ static const rb_data_type_t ibf_load_type = {
95049527
};
95059528

95069529
const rb_iseq_t *
9507-
iseq_ibf_load(VALUE str)
9530+
rb_iseq_ibf_load(VALUE str)
95089531
{
95099532
struct ibf_load *load;
9510-
const rb_iseq_t *iseq;
9533+
rb_iseq_t *iseq;
95119534
VALUE loader_obj = TypedData_Make_Struct(0, struct ibf_load, &ibf_load_type, load);
95129535

95139536
ibf_load_setup(load, loader_obj, str);
95149537
iseq = ibf_load_iseq(load, 0);
95159538

9516-
iseq_init_trace(iseq);
9539+
rb_iseq_init_trace(iseq);
95179540

95189541
RB_GC_GUARD(loader_obj);
95199542
return iseq;
95209543
}
95219544

95229545
VALUE
9523-
iseq_ibf_load_extra_data(VALUE str)
9546+
rb_iseq_ibf_load_extra_data(VALUE str)
95249547
{
95259548
struct ibf_load *load;
95269549
VALUE loader_obj = TypedData_Make_Struct(0, struct ibf_load, &ibf_load_type, load);

configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10652,6 +10652,8 @@ if test "x$ac_cv_header_jemalloc_jemalloc_h" = xyes; then :
1065210652
$as_echo "#define RUBY_ALTERNATIVE_MALLOC_HEADER <jemalloc/jemalloc.h>" >>confdefs.h
1065310653

1065410654

10655+
else
10656+
test x$with_jemalloc = xyes && with_jemalloc=no
1065510657
fi
1065610658

1065710659

configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,8 @@ AS_IF([test "x$with_jemalloc" = xyes],[
13191319
[AC_DEFINE(HAVE_LIBJEMALLOC, 1)], [with_jemalloc=no])
13201320
AC_CHECK_HEADER(jemalloc/jemalloc.h, [
13211321
AC_DEFINE(RUBY_ALTERNATIVE_MALLOC_HEADER, [<jemalloc/jemalloc.h>])
1322-
])
1322+
],
1323+
[test x$with_jemalloc = xyes && with_jemalloc=no])
13231324
AS_IF([test "x$with_jemalloc" = xno], [
13241325
AC_CACHE_CHECK([for jemalloc with JEMALLOC_MANGLE], rb_cv_jemalloc_demangle,
13251326
[AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@define JEMALLOC_MANGLE 1

cont.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,6 +1616,7 @@ fiber_store(rb_fiber_t *next_fib, rb_thread_t *th)
16161616
return fib->cont.value;
16171617

16181618
#else /* FIBER_USE_NATIVE */
1619+
fib->cont.saved_ec.machine.stack_end = NULL;
16191620
if (ruby_setjmp(fib->cont.jmpbuf)) {
16201621
/* restored */
16211622
fib = th->ec->fiber_ptr;
@@ -1931,6 +1932,20 @@ fiber_to_s(VALUE fibval)
19311932
return rb_block_to_s(fibval, &proc->block, status_info);
19321933
}
19331934

1935+
#ifdef HAVE_WORKING_FORK
1936+
void
1937+
rb_fiber_atfork(rb_thread_t *th)
1938+
{
1939+
if (th->root_fiber) {
1940+
if (&th->root_fiber->cont.saved_ec != th->ec) {
1941+
th->root_fiber = th->ec->fiber_ptr;
1942+
th->root_fiber->cont.type = ROOT_FIBER_CONTEXT;
1943+
}
1944+
th->root_fiber->prev = 0;
1945+
}
1946+
}
1947+
#endif
1948+
19341949
/*
19351950
* Document-class: FiberError
19361951
*

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
ruby2.5 (2.5.4-0nkmi1~dist) unstable; urgency=medium
2+
3+
* Ruby 2.5.4
4+
5+
-- Sorah Fukumori <[email protected]> Wed, 13 Mar 2019 12:25:07 +0000
6+
17
ruby2.5 (2.5.3-0nkmi1~dist) unstable; urgency=medium
28

39
* Ruby 2.5.3

debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Build-Depends: bison,
2121
ruby:native <cross>,
2222
rubygems-integration (>= 1.6),
2323
systemtap-sdt-dev [linux-any],
24+
tzdata,
2425
zlib1g-dev
2526
Standards-Version: 4.1.5
2627
Homepage: http://www.ruby-lang.org/

debian/patches/0004-Make-gemspecs-reproducible.patch

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ From: Antonio Terceiro <[email protected]>
22
Date: Tue, 10 Oct 2017 15:08:43 -0300
33
Subject: Make gemspecs reproducible
44

5-
With an explicit date, they will get the current date and make build
6-
unreproducible
5+
Without an explicit date, they will get the current date and make the
6+
build unreproducible
77
---
88
ext/bigdecimal/bigdecimal.gemspec | 1 +
9+
ext/fiddle/fiddle.gemspec | 1 +
910
ext/io/console/io-console.gemspec | 2 +-
11+
lib/ipaddr.gemspec | 1 +
1012
lib/rdoc/rdoc.gemspec | 1 +
11-
3 files changed, 3 insertions(+), 1 deletion(-)
13+
5 files changed, 5 insertions(+), 1 deletion(-)
1214

1315
diff --git a/ext/bigdecimal/bigdecimal.gemspec b/ext/bigdecimal/bigdecimal.gemspec
1416
index c8c9087..9cf22f7 100644
@@ -22,6 +24,18 @@ index c8c9087..9cf22f7 100644
2224
s.email = ["[email protected]"]
2325

2426
s.summary = "Arbitrary-precision decimal floating-point number library."
27+
diff --git a/ext/fiddle/fiddle.gemspec b/ext/fiddle/fiddle.gemspec
28+
index b29f4ec..36ed213 100644
29+
--- a/ext/fiddle/fiddle.gemspec
30+
+++ b/ext/fiddle/fiddle.gemspec
31+
@@ -2,6 +2,7 @@
32+
Gem::Specification.new do |spec|
33+
spec.name = "fiddle"
34+
spec.version = '1.0.0'
35+
+ spec.date = RUBY_RELEASE_DATE
36+
spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"]
37+
38+
2539
diff --git a/ext/io/console/io-console.gemspec b/ext/io/console/io-console.gemspec
2640
index 822d3eb..18d2887 100644
2741
--- a/ext/io/console/io-console.gemspec
@@ -35,6 +49,18 @@ index 822d3eb..18d2887 100644
3549
s.summary = "Console interface"
3650
s.email = "[email protected]"
3751
s.description = "add console capabilities to IO instances."
52+
diff --git a/lib/ipaddr.gemspec b/lib/ipaddr.gemspec
53+
index 16df170..433e43b 100644
54+
--- a/lib/ipaddr.gemspec
55+
+++ b/lib/ipaddr.gemspec
56+
@@ -5,6 +5,7 @@
57+
Gem::Specification.new do |spec|
58+
spec.name = "ipaddr"
59+
spec.version = "1.2.0"
60+
+ spec.date = RUBY_RELEASE_DATE
61+
spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"]
62+
63+
3864
diff --git a/lib/rdoc/rdoc.gemspec b/lib/rdoc/rdoc.gemspec
3965
index 8c92908..0e6c0c7 100644
4066
--- a/lib/rdoc/rdoc.gemspec

0 commit comments

Comments
 (0)