Skip to content

Commit a52e914

Browse files
committed
Merge branch 'master-2.3' into dist/2.3/xenial
2 parents c428586 + 313d751 commit a52e914

Some content is hidden

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

92 files changed

+1401
-448
lines changed

ChangeLog

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,84 @@
1+
Wed Mar 29 23:47:31 2017 CHIKANAGA Tomoyuki <[email protected]>
2+
3+
* hash.c (any_hash): fix CI failure on L32LLP64 architecture.
4+
The patch was provided by usa. [ruby-core:80484] [Bug #13376]
5+
6+
Wed Mar 29 06:22:27 2017 CHIKANAGA Tomoyuki <[email protected]>
7+
8+
* hash.c (any_hash): fix Symbol#hash to be nondeterministic.
9+
The patch was provided by Eric Wong. [ruby-core:80433] [Bug #13376]
10+
11+
* test/ruby/test_symbol.rb: add test for above.
12+
13+
Tue Mar 28 00:38:39 2017 NAKAMURA Usaku <[email protected]>
14+
15+
* win32/win32.c (poll_child_status): rb_w32_wait_events_blocking() sets
16+
errno internally, then should not set it here.
17+
18+
Mon Mar 27 20:15:17 2017 Kazuki Tsujimoto <[email protected]>
19+
20+
* eval.c, method.h, proc.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c:
21+
TracePoint#method_id should return method_id, not callee_id.
22+
[ruby-core:77241] [Feature #12747]
23+
24+
* test/ruby/test_settracefunc.rb: change accordingly.
25+
26+
Mon Mar 27 20:12:23 2017 Anton Davydov <[email protected]>
27+
28+
* lib/uri/mailto.rb: Removed needless `return` and use `.`` instead of `::`
29+
with class method.
30+
* test/uri/test_mailto.rb: Added tests for coverage.
31+
32+
Mon Mar 20 06:35:08 2017 Nobuyoshi Nakada <[email protected]>
33+
34+
* ruby.c (process_options): convert -e script to the encoding
35+
given by a command line option on Windows. assume it is the
36+
expected encoding. [ruby-dev:49461] [Bug #11900]
37+
38+
Mon Mar 20 05:47:49 2017 Koichi Sasada <[email protected]>
39+
40+
* test/ruby/test_exception.rb: fix thread issues.
41+
* use Queue instead of a local variable for synchronization.
42+
* join created thread to soleve leaking threads warning.
43+
44+
Mon Mar 20 05:47:49 2017 Nobuyoshi Nakada <[email protected]>
45+
46+
* thread.c (rb_threadptr_raise): set cause from the called thread,
47+
but not from the thread to be interrupted.
48+
[ruby-core:77222] [Bug #12741]
49+
50+
Wed Feb 8 02:17:02 2017 Nobuyoshi Nakada <[email protected]>
51+
52+
* lib/forwardable.rb (Forwardable._delegator_method): extract
53+
method generator and deal with non-module objects.
54+
[ruby-dev:49656] [Bug #12478]
55+
56+
Wed Feb 8 02:17:02 2017 Nobuyoshi Nakada <[email protected]>
57+
58+
* lib/forwardable.rb (def_instance_delegator): adjust backtrace of
59+
method body by tail call optimization. adjusting the delegated
60+
target is still done by deleting backtrace.
61+
62+
* lib/forwardable.rb (def_single_delegator): ditto.
63+
64+
Tue Jan 17 03:51:48 2017 Nobuyoshi Nakada <[email protected]>
65+
66+
* compile.c (setup_args): duplicate splatting array if more
67+
arguments present to obey left-to-right execution order.
68+
[ruby-core:77701] [Bug# 12860]
69+
70+
Thu Nov 24 05:47:18 2016 CHIKANAGA Tomoyuki <[email protected]>
71+
72+
* test/fileutils/test_fileutils.rb (TestFileUtils#setup): Use primary
73+
group as well as supplementary groups.
74+
based on the patch by Vit Ondruch at [Bug #12910]
75+
76+
Thu Nov 24 05:44:04 2016 CHIKANAGA Tomoyuki <[email protected]>
77+
78+
* test/ruby/test_dir_m17n.rb: Don't encode to UTF-8 if it's unnecessary.
79+
If the file system encoding is ISO-8851-1 or if the encoding of the
80+
target string is invalid, don't encode to UTF-8. [Bug#12972]
81+
182
Mon Nov 21 16:55:15 2016 boshan <[email protected]>
283

384
* lib/tempfile.rb (Tempfile#initialize): [DOC] the first parameter

array.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,13 +2886,15 @@ select_bang_ensure(VALUE a)
28862886
long len = RARRAY_LEN(ary);
28872887
long i1 = arg->len[0], i2 = arg->len[1];
28882888

2889-
if (i2 < i1) {
2889+
if (i2 < len && i2 < i1) {
2890+
long tail = 0;
28902891
if (i1 < len) {
2892+
tail = len - i1;
28912893
RARRAY_PTR_USE(ary, ptr, {
2892-
MEMMOVE(ptr + i2, ptr + i1, VALUE, len - i1);
2894+
MEMMOVE(ptr + i2, ptr + i1, VALUE, tail);
28932895
});
28942896
}
2895-
ARY_SET_LEN(ary, len - i1 + i2);
2897+
ARY_SET_LEN(ary, i2 + tail);
28962898
}
28972899
return ary;
28982900
}
@@ -5063,7 +5065,7 @@ rb_ary_combination(VALUE ary, VALUE num)
50635065
rb_yield(rb_ary_new2(0));
50645066
}
50655067
else if (n == 1) {
5066-
for (i = 0; i < len; i++) {
5068+
for (i = 0; i < RARRAY_LEN(ary); i++) {
50675069
rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
50685070
}
50695071
}
@@ -5262,7 +5264,7 @@ rb_ary_repeated_combination(VALUE ary, VALUE num)
52625264
rb_yield(rb_ary_new2(0));
52635265
}
52645266
else if (n == 1) {
5265-
for (i = 0; i < len; i++) {
5267+
for (i = 0; i < RARRAY_LEN(ary); i++) {
52665268
rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
52675269
}
52685270
}
@@ -5590,7 +5592,8 @@ rb_ary_dig(int argc, VALUE *argv, VALUE self)
55905592
* This method is safe to use with mutable objects such as hashes, strings or
55915593
* other arrays:
55925594
*
5593-
* Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
5595+
* Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
5596+
* Array.new(4) {|i| i.to_s } #=> ["0", "1", "2", "3"]
55945597
*
55955598
* This is also a quick way to build up multi-dimensional arrays:
55965599
*

class.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,9 @@ singleton_class_of(VALUE obj)
15781578
switch (BUILTIN_TYPE(obj)) {
15791579
case T_FLOAT: case T_BIGNUM: case T_SYMBOL:
15801580
goto no_singleton;
1581+
case T_STRING:
1582+
if (FL_TEST_RAW(obj, RSTRING_FSTR)) goto no_singleton;
1583+
break;
15811584
}
15821585
}
15831586

@@ -1947,6 +1950,9 @@ rb_extract_keywords(VALUE *orighash)
19471950
}
19481951
st_foreach(rb_hash_tbl_raw(hash), separate_symbol, (st_data_t)&parthash);
19491952
*orighash = parthash[1];
1953+
if (parthash[1] && RBASIC_CLASS(hash) != rb_cHash) {
1954+
RBASIC_SET_CLASS(parthash[1], RBASIC_CLASS(hash));
1955+
}
19501956
return parthash[0];
19511957
}
19521958

@@ -2002,7 +2008,7 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
20022008
}
20032009
}
20042010
if (!rest && keyword_hash) {
2005-
if (RHASH_SIZE(keyword_hash) > (unsigned int)j) {
2011+
if (RHASH_SIZE(keyword_hash) > (unsigned int)(values ? 0 : j)) {
20062012
unknown_keyword_error(keyword_hash, table, required+optional);
20072013
}
20082014
}

compile.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,6 @@ validate_labels(rb_iseq_t *iseq, st_table *labels_table)
544544
{
545545
st_foreach(labels_table, validate_label, (st_data_t)iseq);
546546
st_free_table(labels_table);
547-
if (!NIL_P(ISEQ_COMPILE_DATA(iseq)->err_info)) {
548-
rb_exc_raise(ISEQ_COMPILE_DATA(iseq)->err_info);
549-
}
550547
}
551548

552549
VALUE
@@ -1108,6 +1105,9 @@ new_child_iseq(rb_iseq_t *iseq, NODE *node,
11081105
static int
11091106
iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
11101107
{
1108+
if (RTEST(ISEQ_COMPILE_DATA(iseq)->err_info))
1109+
return COMPILE_NG;
1110+
11111111
/* debugs("[compile step 2] (iseq_array_to_linkedlist)\n"); */
11121112

11131113
if (compile_debug > 5)
@@ -3615,7 +3615,7 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned int *flag, s
36153615
switch (nd_type(argn)) {
36163616
case NODE_SPLAT: {
36173617
COMPILE(args, "args (splat)", argn->nd_head);
3618-
ADD_INSN1(args, nd_line(argn), splatarray, Qfalse);
3618+
ADD_INSN1(args, nd_line(argn), splatarray, nsplat ? Qtrue : Qfalse);
36193619
argc = INT2FIX(1);
36203620
nsplat++;
36213621
*flag |= VM_CALL_ARGS_SPLAT;
@@ -3629,7 +3629,7 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned int *flag, s
36293629
INIT_ANCHOR(tmp);
36303630
COMPILE(tmp, "args (cat: splat)", argn->nd_body);
36313631
if (nd_type(argn) == NODE_ARGSCAT) {
3632-
ADD_INSN1(tmp, nd_line(argn), splatarray, Qfalse);
3632+
ADD_INSN1(tmp, nd_line(argn), splatarray, nsplat ? Qtrue : Qfalse);
36333633
}
36343634
else {
36353635
ADD_INSN1(tmp, nd_line(argn), newarray, INT2FIX(1));

configure.in

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,33 @@ if test "$GCC" = yes; then
894894
# various headers. Most frequent situation is the use of //
895895
# comments. We bypass ANSI C mode for them. Otherwise
896896
# extension libs cannot include those headers.
897+
898+
# Since math.h in some mingw64 wrongly delcares frexp and modf
899+
# to be pure, the variables pointed by the second arguments are
900+
# considered uninitialized unexpectedly.
901+
AC_CACHE_CHECK([whether frexp and modf are broken],
902+
rb_cv_mingw64_broken_frexp_modf,
903+
[
904+
save_CFLAGS="$CFLAGS"
905+
if test "$particular_werror_flags" = "yes"; then
906+
CFLAGS="$CFLAGS -Werror=uninitialized"
907+
else
908+
CFLAGS="$CFLAGS -Werror -Wuninitialized"
909+
fi
910+
AC_TRY_COMPILE([@%:@include <math.h>
911+
int foo(double x)
912+
{
913+
int exp;
914+
frexp(x, &exp);
915+
return exp;
916+
}], [if (foo(0.0)) return 1;],
917+
[rb_cv_mingw64_broken_frexp_modf=no],
918+
[rb_cv_mingw64_broken_frexp_modf=yes])
919+
CFLAGS="$save_CFLAGS"
920+
])
921+
if test "$rb_cv_mingw64_broken_frexp_modf" = yes; then
922+
AC_DEFINE(RUBY_MINGW64_BROKEN_FREXP_MODF)
923+
fi
897924
],
898925
[cygwin*|darwin*|netbsd*|nacl], [
899926
# need lgamma_r(), finite()
@@ -1024,6 +1051,12 @@ AS_CASE(["$target_os"],
10241051
],
10251052
[macosx_10_5=yes], [macosx_10_5=no])
10261053
AC_MSG_RESULT($macosx_10_5)
1054+
AS_IF([test "${target_os@%:@darwin}" -ge 16], [
1055+
ac_cv_func___syscall=no
1056+
ac_cv_func_syscall=no
1057+
ac_cv_header_sys_syscall_h=no
1058+
ac_cv_header_syscall_h=no
1059+
])
10271060
if test $macosx_10_5 = yes; then
10281061
ac_cv_func_getcontext=no
10291062
ac_cv_func_setcontext=no
@@ -3745,8 +3778,8 @@ AS_CASE("$enable_shared", [yes], [
37453778
LIBRUBY_RELATIVE=yes
37463779
fi
37473780
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-install_name '${libprefix}'/$(LIBRUBY_SO)'
3748-
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(MAJOR).$(MINOR).$(TEENY)'
3749-
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(RUBY_PROGRAM_VERSION)'
3781+
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(MAJOR).$(MINOR)'
3782+
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(RUBY_PROGRAM_VERSION)'
37503783
if test "$visibility_option" = ld; then
37513784
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_*'
37523785
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_ruby_static_id_*'

cont.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static VALUE rb_eFiberError;
167167
if (!(ptr)) rb_raise(rb_eFiberError, "uninitialized fiber"); \
168168
} while (0)
169169

170-
NOINLINE(static VALUE cont_capture(volatile int *stat));
170+
NOINLINE(static VALUE cont_capture(volatile int *volatile stat));
171171

172172
#define THREAD_MUST_BE_RUNNING(th) do { \
173173
if (!(th)->tag) rb_raise(rb_eThreadError, "not running thread"); \
@@ -475,13 +475,9 @@ cont_new(VALUE klass)
475475
}
476476

477477
static VALUE
478-
cont_capture(volatile int *stat)
479-
#if defined(__clang__) && \
480-
__clang_major__ == 3 && __clang_minor__ == 8 && __clang_patch__ == 0
481-
__attribute__ ((optnone))
482-
#endif
478+
cont_capture(volatile int *volatile stat)
483479
{
484-
rb_context_t *cont;
480+
rb_context_t *volatile cont;
485481
rb_thread_t *th = GET_THREAD();
486482
volatile VALUE contval;
487483

debian/changelog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
ruby2.3 (2.3.4-0nkmi1) unstable; urgency=medium
2+
3+
* new upstream version
4+
* Forward port r58141@ruby_2_2 to recover rb_thread_fd_close which
5+
is unintentionally removed in 2.3.4.
6+
7+
-- Sorah Fukumori <[email protected]> Sun, 09 Apr 2017 12:56:51 +0000
8+
19
ruby2.3 (2.3.3-0nkmi1~xenial) xenial; urgency=medium
210

311
* new upstream version

dln.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,9 @@ dln_load(const char *file)
13311331
void *ex = dlsym(handle, EXTERNAL_PREFIX"ruby_xmalloc");
13321332
if (ex && ex != ruby_xmalloc) {
13331333

1334-
# if defined __APPLE__
1334+
# if defined __APPLE__ && \
1335+
defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
1336+
(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11)
13351337
/* dlclose() segfaults */
13361338
rb_fatal("%s - %s", incompatible, file);
13371339
# else

doc/extension.ja.rdoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,10 +1397,10 @@ int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optiona
13971397
optional (optionalが負の場合は-optional-1) 個のIDは省略可能
13981398
キーワードです.必須キーワードがkeyword_hash中にない場合,
13991399
"missing keyword"ArgumentErrorが発生します.省略可能キーワー
1400-
ドがない場合は,values中の対応する要素は変更されません.
1401-
keyword_hashに使用されない要素がある場合は,optionalが負なら
1402-
新しいHashとして省略可能引数の次に保存されますが,そうでなけ
1403-
れば"unknown keyword"ArgumentErrorが発生します.
1400+
ドがない場合は,values中の対応する要素にはQundefがセットされ
1401+
ます.keyword_hashに使用されない要素がある場合は,optionalが
1402+
負なら無視されますが,そうでなければ"unknown keyword"
1403+
ArgumentErrorが発生します.
14041404

14051405
VALUE rb_extract_keywords(VALUE *original_hash) ::
14061406

doc/extension.rdoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,10 +1410,9 @@ int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optiona
14101410
+optional+ is negative) number of IDs are optional. If a
14111411
mandatory key is not contained in +keyword_hash+, raises "missing
14121412
keyword" +ArgumentError+. If an optional key is not present in
1413-
+keyword_hash+, the corresponding element in +values+ is not changed.
1414-
If +optional+ is negative, rest of +keyword_hash+ are stored in the
1415-
next to optional +values+ as a new Hash, otherwise raises "unknown
1416-
keyword" +ArgumentError+.
1413+
+keyword_hash+, the corresponding element in +values+ is set to +Qundef+.
1414+
If +optional+ is negative, rest of +keyword_hash+ are ignored, otherwise
1415+
raises "unknown keyword" +ArgumentError+.
14171416

14181417
Be warned, handling keyword arguments in the C API is less efficient
14191418
than handling them in Ruby. Consider using a Ruby wrapper method

0 commit comments

Comments
 (0)