This fixes at least an issue where irb will incorrectly assume
code opens a heredoc when it does not, such as this code:
```ruby
s1 = 'testing'
s2 = 'this'
s2 <<s1
p s1
s1
```
Ruby parses the `s2 <<s1` as `s2.<<(s1)`, not as a heredoc, because
`s2` is a local variable in scope. irb was using ripper without
letting ripper know that `s2` was a local variable, so ripper would
lex it as a heredoc instead of a method call.
Fix the situation by prepending a line at line 0 with all local
variable definitions in scope whenever lexing. This fixes the
heredoc issue, and potentially other issues that depend on whether
an identifier is a local variable or not.
Fixes [Bug #17530]
https://github.com/ruby/irb/commit/4ed2187f76
- Add UNICODE_VERSION,... to deal with new location of some
of the emoji-related data files.
- Introduce class BreakFile to handle various file properties.
- Adapt main code to use BreakFile.
- Limit Unicode version 12.1.0 to Ruby versions 2.6.3 - 3.0
- Check that Ruby version 3.1 has Unicode version 13.0.0
- Limit Unicode Emoji version 12.1 to Ruby versions 2.7 - 3.0
- Check that Ruby version 3.1 has Unicode Emoji version 13.0
- Change location of file emoji-data.txt
- Change range of files in emoji directory
([stz] is for emoji-sequences.txt, emoji-test.txt, and emoji-zwj-sequences.txt)
- Make sure that version of all emoji files is checked against Emoji version
- Change Unicode version to 13.0.0
- Change Emoji version to 13.0
- Adjust to moved locations of emoji-data.txt and emoji-variation-sequences.txt
by splitting these files from $(UNICODE_EMOJI_FILES) and putting them into
a new group $(UNICODE_UCD_EMOJI_FILES)
Find jemalloc header first, then using the found header, try [with
mangle, without mangle] x [no more additional libraries, adding
jemalloc] combination.
It is reported that combination of `--enable-shared --with-jemalloc`
breaks on Debian bullseye (testig). Deeper investigation revealed that
this system's `ld(1)` is patched, to turn `ld --as-needed` on by
default.
This linker flag strips "unnecessary" library dependencies from an
executable. In case of `ruby(1)` (of `--enable-shared`), because
everything is in `libruby.so`, the binary itself doesn't include any
calls to `malloc(3)` at all. So in spite of our explicit `-ljemalloc`
flag, it is ignored. Libc's one is chosen instead.
This is not what we want. Let's force our `ruby(1)` link what we want.
Fixes https://github.com/ruby/ruby/pull/4627
The author would like to acknowledge
Akihiko Odaki <akihiko.odaki@gmail.com> for their contributions.
Since b2fc592c30 nothing was holding a reference to the dup'd CDHASH
during IBF loading. If a GC happened to run during IBF load then the
copied hash wouldn't have anything to keep it alive. We don't really
want to keep the originally loaded CDHASH hash, so this patch just
overwrites the original hash with the copied / modified hash.
[Bug #17984] [ruby-core:104259]