Age | Commit message (Collapse) | Author |
|
merged https://github.com/rubygems/rubygems/pull/2765
|
|
[Bug #15850]
|
|
This commit adds an alternative packing strategy for compaction.
Instead of packing towards "most pinned" pages, we can pack towards
"most empty" pages. The idea is that we can double the heap size, then
pack all objects towards the empty side of the heap. This will ensure
maximum chaos for testing / verification.
|
|
|
|
|
|
|
|
|
|
Aliasing a method preserves its visibility. These aliases turn
formerly-public methods into private. Should make them public
again. [Bug #15847]
|
|
Instead, look for instance methods of Kernel.
Otherwise, instance methods of Module (which are methods of Kernel
itself) are mistakenly believed to exist, and it fails when calling
Kernel.instance_method().
Closes: https://github.com/ruby/ruby/pull/1422
|
|
|
|
|
|
|
|
|
|
This reverts commit b1767e56b158d8307412a0928a7ac2366541429d.
|
|
|
|
|
|
to fix
https://ci.appveyor.com/project/ruby/ruby/builds/24438615/job/yld1utsltxag9dr2
|
|
This is a follow up for 3f9562015e651735bfc2fdd14e8f6963b673e22a.
Before this commit, it was possible to create a shared string which
shares with another shared string by passing a frozen shared string
to `str_duplicate`.
Such string looks like:
```
-------- -----------------
| root | ------ owns -----> | root's buffer |
-------- -----------------
^ ^ ^
----------- | |
| shared1 | ------ references ----- |
----------- |
^ |
----------- |
| shared2 | ------ references ---------
-----------
```
This is bad news because `rb_fstring(shared2)` can make `shared1`
independent, which severs the reference from `shared1` to `root`:
```c
/* from fstr_update_callback() */
str = str_new_frozen(rb_cString, shared2); /* can return shared1 */
if (STR_SHARED_P(str)) { /* shared1 is also a shared string */
str_make_independent(str); /* no frozen check */
}
```
If `shared1` was the only reference to `root`, then `root` can be
reclaimed by the GC, leaving `shared2` in a corrupted state:
```
----------- --------------------
| shared1 | -------- owns --------> | shared1's buffer |
----------- --------------------
^
|
----------- -------------------------
| shared2 | ------ references ----> | root's buffer (freed) |
----------- -------------------------
```
Here is a reproduction script for the situation this commit fixes.
```ruby
a = ('a' * 24).strip.freeze.strip
-a
p a
4.times { GC.start }
p a
```
- string.c (str_duplicate): always share with the root string when
the original is a shared string.
- test_rb_str_dup.rb: specifically test `rb_str_dup` to make
sure it does not try to share with a shared string.
[Bug #15792]
Closes: https://github.com/ruby/ruby/pull/2159
|
|
|
|
to prevent failure like
https://app.wercker.com/ruby/ruby/runs/mjit-test1/5cd28aa6ab79a30008ee819b?step=5cd28b2403f44600070db083
with --jit-verbose=1.
|
|
[Bug #15780]
|
|
This allows cases such as:
```ruby
m ->(a = ->{@1}) {a}
m.call.call(1)
m2 ->(a: ->{@1}) {a}
m2.call.call(2)
```
Previously, this would cause a syntax error.
[Bug#15789]
|
|
Because `proc{|| @1}` is a syntax error, the following should
also be syntax errors:
```ruby
proc { |
| @1}
```
```ruby
proc { |; a| @1 }
```
This fixes both cases.
[Bug #15825]
|
|
* parse.y (case_args): moved "duplicated when clause" warning from
compile phase, so that `ruby -wc` shows them.
|
|
|
|
|
|
|
|
|
|
Closes: https://github.com/ruby/ruby/pull/2163
|
|
|
|
The debug option of IRB is deleted because it's just for IRB's pure Ruby
parser.
|
|
|
|
|
|
* lib/reine.rb, lib/reline/*: Reline is a readline stdlib compatible
library.
* lib/readline.rb: Readline uses a fallback to Reline when ext/readline
doesn't exist.
* tool/sync_default_gems.rb: add ruby/reline as a default gem.
* appveyor.yml: add "set RELINE_TEST_ENCODING=Windows-31J" for test suit
of Reline, and add "--exclude readline" to "nmake test-all" on Visual
Studio builds because of strange behavior.
* spec/ruby/library/readline/spec_helper.rb: skip Reline as with
RbReadline.
|
|
* parse.y (heredoc_identifier): CR in here-document identifier
might or might not result in a syntax error, by the EOL code.
make a syntax error regardless of the EOL code.
|
|
|
|
* parse.y (heredoc_identifier): quoted here-document identifier
must end within the same line.
the only corner case that here-document identifier can contain a
newline is that the closing qoute is placed at the beginning of
the next line, and has been warned since 2.4.
```ruby
<<"EOS
" # warning: here document identifier ends with a newline
EOS
```
|
|
````
0b01001101[2, 4] #=> 0b0011
0b01001100[2..5] #=> 0b0011
0b01001100[2...6] #=> 0b0011
^^^^
````
[Feature #8842]
|
|
|
|
from https://github.com/ruby/irb/commit/e8e79d569ed59fe4ed4fbca968917ce799f02a5e.
This colorizes Range object on IRB inspect.
|
|
from https://github.com/ruby/irb/commit/96f05e726879e9858eb015c8d043c9f52b864ff9.
Just syncing newer test changes so that conflicts do not happen when trunk is
modified and we need to backport that to ruby/irb.
|
|
from https://github.com/ruby/irb/commit/44301d382794d91e2caa16dd4efe62439e0041d8.
This includes some fixes for string interpolation highlight fixes.
|
|
Closes: https://github.com/ruby/ruby/pull/2154
|
|
This string can include elements that were not in either string
passed to File.realpath, even if one of the strings is an
absolute path, due to symlinks:
```ruby
Dir.mkdir('b') unless File.directory?('b')
File.write('b/a', '') unless File.file?('b/a')
File.symlink('b', 'c') unless File.symlink?('c')
path = File.realpath('c/a'.untaint, Dir.pwd.untaint)
path # "/home/testr/ruby/b/a"
path.tainted? # should be true, as 'b' comes from file system
```
[Bug #15803]
|
|
|
|
from https://github.com/ruby/irb/commit/89e9add06da3fd5f9ce91a2f5fa0b0190aa5d42f.
This adds syntax highlight support for Module on inspect.
In addition to that, I'm adding a trailing space in test_color.rb for
testing ruby-commit-hook's auto-style.
|
|
Synced from https://github.com/ruby/irb/commit/5feb361ed80736efa5b2c2b629837ec2a5fc2cdb.
This includes a support to colorize named Class instance on IRB inspect.
|
|
* string.c (str_duplicate): share the root shared string if the
original string is already sharing, so that all shared strings
refer the root shared string directly. indirect sharing can
cause a dangling pointer.
[Bug #15792]
|
|
Wercker seems to randomly fail
https://app.wercker.com/ruby/ruby/runs/mjit-test1/5cc3c1c423fcb70008db9b64?step=5cc3c46a03f4460007da0659
To help debugging, let me isolate the impact from GC.compact in the JIT
testing on Wercker.
|
|
Backport changes from ruby/irb.
|