Skip to content

Commit a32e3ec

Browse files
committed
Imported Upstream version 2.4.1
1 parent a7608a9 commit a32e3ec

File tree

151 files changed

+2867
-1218
lines changed

Some content is hidden

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

151 files changed

+2867
-1218
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ branches:
5959
- ruby_2_1
6060
- ruby_2_2
6161
- ruby_2_3
62+
- ruby_2_4
6263
- /^feature\//
6364
- /^bug\//
6465

NEWS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ with all sufficient information, see the ChangeLog file or Redmine
140140
* Regexp#match? [Feature #8110]
141141
This returns bool and doesn't save backref.
142142

143-
* Update Onigmo 6.0.0.
143+
* Update Onigmo 6.1.1.
144+
* Support absent operator https://github.com/k-takata/Onigmo/issues/82
144145

145146
* Regexp/String: Updated Unicode version from 8.0.0 to 9.0.0 [Feature #12513]
146147

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ This is what you need to do to compile and install Ruby:
9797

9898
6. Run `make`.
9999

100+
* On Mac, set RUBY\_CODESIGN environment variable with a signing identity.
101+
It uses the identity to sign `ruby` binary. See also codesign(1).
102+
100103
7. Optionally, run '`make check`' to check whether the compiled Ruby
101104
interpreter works well. If you see the message "`check succeeded`", your
102105
ruby works as it should (hopefully).

array.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,14 +2437,14 @@ sort_2(const void *ap, const void *bp, void *dummy)
24372437
* an integer less than 0 when +b+ follows +a+, +0+ when +a+ and +b+
24382438
* are equivalent, or an integer greater than 0 when +a+ follows +b+.
24392439
*
2440-
* The result is not guaranteed as stable. When comparison of two
2440+
* The result is not guaranteed to be stable. When the comparison of two
24412441
* elements returns +0+, the order of the elements is unpredictable.
24422442
*
2443-
* See also Enumerable#sort_by.
2444-
*
24452443
* a = [ "d", "a", "e", "c", "b" ]
24462444
* a.sort! #=> ["a", "b", "c", "d", "e"]
24472445
* a.sort! { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
2446+
*
2447+
* See also Enumerable#sort_by.
24482448
*/
24492449

24502450
VALUE
@@ -2521,14 +2521,14 @@ rb_ary_sort_bang(VALUE ary)
25212521
* an integer less than 0 when +b+ follows +a+, +0+ when +a+ and +b+
25222522
* are equivalent, or an integer greater than 0 when +a+ follows +b+.
25232523
*
2524-
* The result is not guaranteed as stable. When comparison of two
2524+
* The result is not guaranteed to be stable. When the comparison of two
25252525
* elements returns +0+, the order of the elements is unpredictable.
25262526
*
2527-
* See also Enumerable#sort_by.
2528-
*
25292527
* a = [ "d", "a", "e", "c", "b" ]
25302528
* a.sort #=> ["a", "b", "c", "d", "e"]
25312529
* a.sort { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
2530+
*
2531+
* See also Enumerable#sort_by.
25322532
*/
25332533

25342534
VALUE
@@ -2680,11 +2680,12 @@ sort_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, dummy))
26802680
* Sorts +self+ in place using a set of keys generated by mapping the
26812681
* values in +self+ through the given block.
26822682
*
2683-
* The result is not guaranteed as stable. When two keys are equal,
2683+
* The result is not guaranteed to be stable. When two keys are equal,
26842684
* the order of the corresponding elements is unpredictable.
26852685
*
26862686
* If no block is given, an Enumerator is returned instead.
26872687
*
2688+
* See also Enumerable#sort_by.
26882689
*/
26892690

26902691
static VALUE
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
i = 0
2+
while i<6_000_000 # benchmark loop 2
3+
i += 1
4+
Module.new.const_set(:X, Module.new)
5+
end

benchmark/bm_vm2_module_const_set.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
i = 0
2+
module M
3+
end
4+
$VERBOSE = nil
5+
while i<6_000_000 # benchmark loop 2
6+
i += 1
7+
M.const_set(:X, Module.new)
8+
end

bignum.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4057,9 +4057,6 @@ rb_cstr_parse_inum(const char *str, ssize_t len, char **endp, int base)
40574057
sign = 0;
40584058
}
40594059
ASSERT_LEN();
4060-
if (str[0] == '+' || str[0] == '-') {
4061-
goto bad;
4062-
}
40634060
}
40644061
if (base <= 0) {
40654062
if (str[0] == '0' && len > 1) {
@@ -4172,6 +4169,7 @@ rb_cstr_parse_inum(const char *str, ssize_t len, char **endp, int base)
41724169
digits_start = str;
41734170
if (!str2big_scan_digits(s, str, base, badcheck, &num_digits, &len))
41744171
goto bad;
4172+
if (endp) *endp = (char *)(str + len);
41754173
digits_end = digits_start + len;
41764174

41774175
if (POW2_P(base)) {
@@ -6101,6 +6099,8 @@ big_fdiv(VALUE x, VALUE y, long ey)
61016099
l = BIGNUM_LEN(x);
61026100
ex = l * BITSPERDIG - nlz(BDIGITS(x)[l-1]);
61036101
ex -= 2 * DBL_BIGDIG * BITSPERDIG;
6102+
if (ex > BITSPERDIG) ex -= BITSPERDIG;
6103+
else if (ex > 0) ex = 0;
61046104
if (ex) x = big_shift(x, ex);
61056105

61066106
bigdivrem(x, y, &z, 0);

class.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,6 +1841,9 @@ rb_extract_keywords(VALUE *orighash)
18411841
}
18421842
st_foreach(rb_hash_tbl_raw(hash), separate_symbol, (st_data_t)&parthash);
18431843
*orighash = parthash[1];
1844+
if (parthash[1] && RBASIC_CLASS(hash) != rb_cHash) {
1845+
RBASIC_SET_CLASS(parthash[1], RBASIC_CLASS(hash));
1846+
}
18441847
return parthash[0];
18451848
}
18461849

0 commit comments

Comments
 (0)