Skip to content

Commit 9a40df8

Browse files
committed
Merge branch 'master-2.4' into dist/2.4/trusty
2 parents e245342 + 8793bb8 commit 9a40df8

File tree

197 files changed

+4367
-2390
lines changed

Some content is hidden

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

197 files changed

+4367
-2390
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ y.tab.c
127127
/enc/*.exp
128128
/enc/*.lib
129129
/enc/unicode/data/*/*.txt
130+
/enc/jis/props.h
130131

131132
# /enc/trans/
132133
/enc/trans/*.c

Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ RMDIRS = @RMDIRS@
164164
RMALL = @RMALL@
165165
NM = @NM@
166166
AR = @AR@
167-
ARFLAGS = @ARFLAGS@
167+
ARFLAGS = @ARFLAGS@$(empty)
168168
RANLIB = @RANLIB@
169169
AS = @AS@
170170
ASFLAGS = @ASFLAGS@ $(INCFLAGS)
@@ -343,7 +343,7 @@ lex.c: defs/keywords
343343

344344
JIS_PROPS_OPTIONS = -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property
345345

346-
enc/jis/props.h: enc/jis/props.kwd
346+
$(srcdir)/enc/jis/props.h: enc/jis/props.kwd
347347
$(MAKEDIRS) $(@D)
348348
@set +e; \
349349
if cmp -s $(?:.kwd=.src) $?; then \

array.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5691,6 +5691,26 @@ rb_ary_dig(int argc, VALUE *argv, VALUE self)
56915691
return rb_obj_dig(argc, argv, self, Qnil);
56925692
}
56935693

5694+
static inline VALUE
5695+
finish_exact_sum(long n, VALUE r, VALUE v, int z)
5696+
{
5697+
if (n != 0)
5698+
v = rb_fix_plus(LONG2FIX(n), v);
5699+
if (r != Qundef) {
5700+
/* r can be an Integer when mathn is loaded */
5701+
if (FIXNUM_P(r))
5702+
v = rb_fix_plus(r, v);
5703+
else if (RB_TYPE_P(r, T_BIGNUM))
5704+
v = rb_big_plus(r, v);
5705+
else
5706+
v = rb_rational_plus(r, v);
5707+
}
5708+
else if (!n && z) {
5709+
v = rb_fix_plus(LONG2FIX(0), v);
5710+
}
5711+
return v;
5712+
}
5713+
56945714
/*
56955715
* call-seq:
56965716
* ary.sum(init=0) -> number
@@ -5772,31 +5792,11 @@ rb_ary_sum(int argc, VALUE *argv, VALUE ary)
57725792
else
57735793
goto not_exact;
57745794
}
5775-
if (n != 0)
5776-
v = rb_fix_plus(LONG2FIX(n), v);
5777-
if (r != Qundef) {
5778-
/* r can be an Integer when mathn is loaded */
5779-
if (FIXNUM_P(r))
5780-
v = rb_fix_plus(r, v);
5781-
else if (RB_TYPE_P(r, T_BIGNUM))
5782-
v = rb_big_plus(r, v);
5783-
else
5784-
v = rb_rational_plus(r, v);
5785-
}
5795+
v = finish_exact_sum(n, r, v, argc!=0);
57865796
return v;
57875797

57885798
not_exact:
5789-
if (n != 0)
5790-
v = rb_fix_plus(LONG2FIX(n), v);
5791-
if (r != Qundef) {
5792-
/* r can be an Integer when mathn is loaded */
5793-
if (FIXNUM_P(r))
5794-
v = rb_fix_plus(r, v);
5795-
else if (RB_TYPE_P(r, T_BIGNUM))
5796-
v = rb_big_plus(r, v);
5797-
else
5798-
v = rb_rational_plus(r, v);
5799-
}
5799+
v = finish_exact_sum(n, r, v, i!=0);
58005800

58015801
if (RB_FLOAT_TYPE_P(e)) {
58025802
/*

bignum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6159,7 +6159,7 @@ rb_big_fdiv_double(VALUE x, VALUE y)
61596159
return big_fdiv_float(x, y);
61606160
}
61616161
else {
6162-
return RFLOAT_VALUE(rb_num_coerce_bin(x, y, rb_intern("fdiv")));
6162+
return NUM2DBL(rb_num_coerce_bin(x, y, rb_intern("fdiv")));
61636163
}
61646164
return dx / dy;
61656165
}

compile.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ iseq_set_arguments_keywords(rb_iseq_t *iseq, LINK_ANCHOR *const optargs,
13071307

13081308
iseq->body->param.flags.has_kw = TRUE;
13091309
iseq->body->param.keyword = keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1);
1310-
keyword->bits_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
1310+
keyword->bits_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_cflag);
13111311

13121312
while (node) {
13131313
NODE *val_node = node->nd_body->nd_value;
@@ -1346,8 +1346,8 @@ iseq_set_arguments_keywords(rb_iseq_t *iseq, LINK_ANCHOR *const optargs,
13461346

13471347
keyword->num = kw;
13481348

1349-
if (args->kw_rest_arg->nd_cflag != 0) {
1350-
keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_cflag);
1349+
if (args->kw_rest_arg->nd_vid != 0) {
1350+
keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
13511351
iseq->body->param.flags.has_kwrest = TRUE;
13521352
}
13531353
keyword->required_num = rkw;
@@ -5037,8 +5037,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int poppe
50375037
ADD_INSN1(ret, line, topn, INT2FIX(1));
50385038
}
50395039
ADD_SEND_WITH_FLAG(ret, line, aid, INT2FIX(1), INT2FIX(asgnflag));
5040+
if (lskip && popped) {
5041+
ADD_LABEL(ret, lskip);
5042+
}
50405043
ADD_INSN(ret, line, pop);
5041-
if (lskip) {
5044+
if (lskip && !popped) {
50425045
ADD_LABEL(ret, lskip);
50435046
}
50445047
}
@@ -5357,7 +5360,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int poppe
53575360
if (liseq->body->param.flags.has_rest) {
53585361
/* rest argument */
53595362
int idx = liseq->body->local_table_size - liseq->body->param.rest_start;
5363+
53605364
ADD_GETLOCAL(args, line, idx, lvar_level);
5365+
ADD_INSN1(args, line, splatarray, Qfalse);
53615366

53625367
argc = liseq->body->param.rest_start + 1;
53635368
flag |= VM_CALL_ARGS_SPLAT;
@@ -6295,14 +6300,17 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int poppe
62956300
}
62966301
case NODE_PRELUDE:{
62976302
const rb_compile_option_t *orig_opt = ISEQ_COMPILE_DATA(iseq)->option;
6303+
VALUE orig_cov = ISEQ_COVERAGE(iseq);
6304+
rb_compile_option_t new_opt = *orig_opt;
62986305
if (node->nd_orig) {
6299-
rb_compile_option_t new_opt = *orig_opt;
63006306
rb_iseq_make_compile_option(&new_opt, node->nd_orig);
63016307
ISEQ_COMPILE_DATA(iseq)->option = &new_opt;
63026308
}
6309+
if (!new_opt.coverage_enabled) ISEQ_COVERAGE_SET(iseq, Qfalse);
63036310
CHECK(COMPILE_POPPED(ret, "prelude", node->nd_head));
63046311
CHECK(COMPILE_(ret, "body", node->nd_body, popped));
63056312
ISEQ_COMPILE_DATA(iseq)->option = orig_opt;
6313+
ISEQ_COVERAGE_SET(iseq, orig_cov);
63066314
break;
63076315
}
63086316
case NODE_LAMBDA:{

complex.c

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,22 @@ f_zero_p(VALUE x)
237237

238238
#define f_nonzero_p(x) (!f_zero_p(x))
239239

240+
VALUE rb_flo_is_finite_p(VALUE num);
241+
inline static int
242+
f_finite_p(VALUE x)
243+
{
244+
if (RB_INTEGER_TYPE_P(x)) {
245+
return TRUE;
246+
}
247+
else if (RB_FLOAT_TYPE_P(x)) {
248+
return (int)rb_flo_is_finite_p(x);
249+
}
250+
else if (RB_TYPE_P(x, T_RATIONAL)) {
251+
return TRUE;
252+
}
253+
return RTEST(rb_funcallv(x, id_finite_p, 0, 0));
254+
}
255+
240256
inline static int
241257
f_kind_of_p(VALUE x, VALUE c)
242258
{
@@ -1217,7 +1233,7 @@ nucomp_hash(VALUE self)
12171233
n = rb_hash(dat->imag);
12181234
h[1] = NUM2LONG(n);
12191235
v = rb_memhash(h, sizeof(h));
1220-
return LONG2FIX(v);
1236+
return ST2FIX(v);
12211237
}
12221238

12231239
/* :nodoc: */
@@ -1326,18 +1342,12 @@ nucomp_inspect(VALUE self)
13261342
static VALUE
13271343
rb_complex_finite_p(VALUE self)
13281344
{
1329-
VALUE magnitude = nucomp_abs(self);
1345+
get_dat1(self);
13301346

1331-
if (FINITE_TYPE_P(magnitude)) {
1347+
if (f_finite_p(dat->real) && f_finite_p(dat->imag)) {
13321348
return Qtrue;
13331349
}
1334-
else if (RB_FLOAT_TYPE_P(magnitude)) {
1335-
const double f = RFLOAT_VALUE(magnitude);
1336-
return isinf(f) ? Qfalse : Qtrue;
1337-
}
1338-
else {
1339-
return rb_funcall(magnitude, id_finite_p, 0);
1340-
}
1350+
return Qfalse;
13411351
}
13421352

13431353
/*

configure.in

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -569,17 +569,23 @@ AS_CASE(["$target_cpu-$target_os"], [[i[3-6]86*]], [
569569
CFLAGS="$save_CFLAGS"
570570
fi])
571571

572+
AS_CASE(["$target_os"], [darwin*], [
573+
if libtool 2>&1 | grep no_warning_for_no_symbols > /dev/null; then
574+
ac_cv_prog_ac_ct_RANLIB=:
575+
ac_cv_prog_ac_ct_AR='libtool -static'
576+
rb_cv_arflags='-no_warning_for_no_symbols -o'
577+
fi
578+
])
572579
AC_CHECK_TOOL(RANLIB, ranlib, :)
573580
AC_CHECK_TOOL(AR, ar)
574581
if test -z "$AR"; then
575582
AC_CHECK_PROGS(AR, aal, ar)
576583
fi
577-
AC_CACHE_CHECK([for $AR D option], [rb_cv_ar_D_option], [
584+
AC_CACHE_CHECK([for $AR flags], [rb_cv_arflags], [
578585
AS_IF([$AR rcD conftest.a > /dev/null 2>&1 && rm conftest.a],
579-
[rb_cv_ar_D_option=yes], [rb_cv_ar_D_option=no])
586+
[rb_cv_arflags=rcD], [rb_cv_arflags=rcu])
580587
])
581-
AS_IF([test "$rb_cv_ar_D_option" = yes], [ARFLAGS='rcD '], [ARFLAGS='rcu '])
582-
AC_SUBST(ARFLAGS)
588+
AC_SUBST(ARFLAGS, ["$rb_cv_arflags "])
583589

584590
AC_CHECK_TOOL(AS, as)
585591
ASFLAGS=$ASFLAGS
@@ -4144,8 +4150,8 @@ AS_CASE(["$target_os"],
41444150
],
41454151
[darwin*], [
41464152
RUBY_APPEND_OPTION(CFLAGS, -pipe)
4147-
RUBY_APPEND_OPTION(XLDFLAGS, [-framework CoreFoundation])
4148-
RUBY_APPEND_OPTION(LIBRUBYARG_STATIC, [-framework CoreFoundation])
4153+
RUBY_APPEND_OPTION(XLDFLAGS, [-framework Foundation])
4154+
RUBY_APPEND_OPTION(LIBRUBYARG_STATIC, [-framework Foundation])
41494155
],
41504156
[osf*], [
41514157
if test "$GCC" != "yes" ; then

constant.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@ int rb_public_const_defined(VALUE klass, ID id);
4646
int rb_public_const_defined_at(VALUE klass, ID id);
4747
int rb_public_const_defined_from(VALUE klass, ID id);
4848
rb_const_entry_t *rb_const_lookup(VALUE klass, ID id);
49+
int rb_autoloading_value(VALUE mod, ID id, VALUE *value, rb_const_flag_t *flag);
4950

5051
#endif /* CONSTANT_H */

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
ruby2.4 (2.4.4-0nkmi1) unstable; urgency=medium
2+
3+
* Ruby 2.4.4
4+
5+
-- Sorah Fukumori <[email protected]> Wed, 28 Mar 2018 23:06:29 +0000
6+
17
ruby2.4 (2.4.3-0nkmi1~trusty) trusty; urgency=medium
28

39
* import 2.4.3

0 commit comments

Comments
 (0)