During compilation, we write keyword default values into the iseq, so we
should mark it to ensure it does not get GC'd.
This might fix issues on ASAN like
http://ci.rvm.jp/logfiles/brlog.trunk_asan.20240927-194923
==805257==ERROR: AddressSanitizer: use-after-poison on address 0x7b7e5e3e2828 at pc 0x5e09ac4822f8 bp 0x7ffde56b0140 sp 0x7ffde56b0138
READ of size 8 at 0x7b7e5e3e2828 thread T0
#0 0x5e09ac4822f7 in RB_BUILTIN_TYPE include/ruby/internal/value_type.h:191:30
#1 0x5e09ac4822f7 in rbimpl_RB_TYPE_P_fastpath include/ruby/internal/value_type.h:352:19
#2 0x5e09ac4822f7 in gc_mark gc/default.c:4488:9
#3 0x5e09ac51011e in rb_iseq_mark_and_move iseq.c:361:17
#4 0x5e09ac4b85c4 in rb_imemo_mark_and_move imemo.c:386:9
#5 0x5e09ac467544 in rb_gc_mark_children gc.c:2508:9
#6 0x5e09ac482c24 in gc_mark_children gc/default.c:4673:5
#7 0x5e09ac482c24 in gc_mark_stacked_objects gc/default.c:4694:9
#8 0x5e09ac482c24 in gc_mark_stacked_objects_all gc/default.c:4732:12
#9 0x5e09ac48c7f9 in gc_marks_rest gc/default.c:5755:9
#10 0x5e09ac48c7f9 in gc_marks gc/default.c:5870:9
#11 0x5e09ac48c7f9 in gc_start gc/default.c:6517:13
The examples of chaining for other methods, such as #tap have the dot at
the start of the line, while #then has it at the end of the previous
line. Updated this to have consistent style in Kernel docs.
It's for avoiding calling release on exit via GC. If it's happen, Ruby
will be crashed because Fiddle::MemoryView's finalizer may refer other
Ruby object. In exit phrase, the referred Ruby object may be already
freed.
https://github.com/ruby/fiddle/commit/02915f13de
Gem command loading errors rely on `#to_s` on the raised exception, but
in the case of `MissingSpecVersionError` that was only the exception
name, making it printed twice and no message at all.
Before:
```
ERROR: Loading command: install (Gem::MissingSpecVersionError)
Gem::MissingSpecVersionError
```
After:
```
ERROR: Loading command: install (Gem::MissingSpecVersionError)
Could not find 'io-wait' (>= 0.a) - did find: [io-wait-0.3.0-java]
Checked in 'GEM_PATH=/Users/deivid/Code/rubygems/rubygems/bundler/tmp/1.1/gems/system' , execute `gem env` for more information
```
https://github.com/rubygems/rubygems/commit/d06944bb2f
This caused an issue when `defined?` was in the `if` condition. Its
instructions weren't appended to the instruction sequence even though it was compiled
if a compile-time known logical short-circuit happened before the `defined?`. The catch table
entry (`defined?` compilation produces a catch table entry) was still on the iseq even though the
instructions weren't there. This caused faulty exception handling in the method.
The solution is to no add the catch table entry for `defined?` after a compile-time known logical
short circuit.
This shouldn't touch much code, it's only for cases like the following,
which can occur during debugging:
if false && defined?(Some::CONSTANT)
"more code..."
end
Fixes [Bug #20501]