Age | Commit message (Collapse) | Author |
|
|
|
Using Fiber#transfer with Fiber#resume for a same Fiber is
limited (once Fiber#transfer is called for a fiber, the fiber
can not be resumed more). This restriction was introduced to
protect the resume/yield chain, but we realized that it is too much
to protect the chain. Instead of the current restriction, we
introduce some other protections.
(1) can not transfer to the resuming fiber.
(2) can not transfer to the yielding fiber.
(3) can not resume transferred fiber.
(4) can not yield from not-resumed fiber.
[Bug #17221]
Also at the end of a transferred fiber, it had continued on root fiber.
However, if the root fiber resumed a fiber (and that fiber can resumed
another fiber), this behavior also breaks the resume/yield chain.
So at the end of a transferred fiber, switch to the edge of resume
chain from root fiber.
For example, root fiber resumed f1 and f1 resumed f2, transferred to
f3 and f3 terminated, then continue from the fiber f2 (it was continued
from root fiber without this patch).
Notes:
Merged: https://github.com/ruby/ruby/pull/3636
|
|
Attempting to create a hard link raises EACCES
|
|
... instead of 1 because it requires "modulo 1". [Bug #17257]
|
|
Also unwrap NODE_RIPPER to check the method name.
Notes:
Merged: https://github.com/ruby/ruby/pull/3649
|
|
|
|
9eda6547812cbda23a73ba3b2620520b0de2bdd6 was fixed by
b9488accf9e2cbf5f7c47b42b3eb23469f0aa58d.
|
|
|
|
[Feature #17104]
|
|
The error message has an integer overflow because it treats an unsigned int as a signed int.
Before:
```
> 3_000_000_000.chr
-1294967296 out of char range (RangeError)
```
After:
```
> 3_000_000_000.chr
3000000000 out of char range (RangeError)
```
Redmine ticket: https://bugs.ruby-lang.org/issues/17186
Notes:
Merged: https://github.com/ruby/ruby/pull/3602
|
|
I want to work with ASAN, but some child environments are not inheriting
the ASAN options I'm using. This commit passes them to child
environments if specified
|
|
In general accepting arbitrary keywords is a bad idea unless you are
delegating keywords or acting on arbitrary keywords. In this case,
the category keyword is ignored, and it's less error prone to not
ignore all keywords.
Notes:
Merged: https://github.com/ruby/ruby/pull/3508
|
|
The documentation already stated this was an error in one case
(when it was previously a warning). Describe the other case,
where chdir without block is called inside block passed to chdir.
Fixes [Bug #15661]
Notes:
Merged: https://github.com/ruby/ruby/pull/3591
|
|
test_io.rb"
* This partially reverts commit dead7478748a828c45e16134fca812bc7771344e.
* Windows will not allow a file to be unlinked if any file handles exist,
see https://github.com/ruby/ruby/pull/3597
|
|
|
|
by explicitly setting `Warning[:deprecated] = true`.
I removed "capture_io" at 79063d8cbfb7ce4740774289252a2a20dc9a5dc1, but
it printed the warning when `RUBYOPT=-w`.
This change makes the warnings enabled explicitly, capture and check the
warning.
|
|
|
|
The deprecation warning was disabled, and the code to check the warning
was removed at 996af2ce086249e904b2ce95ab2fcd1de7d757be, thus capture_io
is no longer needed.
|
|
Matz want to try to freeze all Range objects.
[Feature #15504]
Notes:
Merged: https://github.com/ruby/ruby/pull/3583
|
|
* Add buffer protocol
* Modify for some review comments
* Per-object buffer availability
* Rename to MemoryView from Buffer and make compilable
* Support integral repeat count in memory view format
* Support 'x' for padding bytes
* Add rb_memory_view_parse_item_format
* Check type in rb_memory_view_register
* Update dependencies in common.mk
* Add test of MemoryView
* Add test of rb_memory_view_init_as_byte_array
* Add native size format test
* Add MemoryView test utilities
* Add test of rb_memory_view_fill_contiguous_strides
* Skip spaces in format string
* Support endianness specifiers
* Update documentation
* Support alignment
* Use RUBY_ALIGNOF
* Fix format parser to follow the pack format
* Support the _ modifier
* Parse count specifiers in get_format_size function.
* Use STRUCT_ALIGNOF
* Fix test
* Fix test
* Fix total size for the case with tail padding
* Fix rb_memory_view_get_item_pointer
* Fix rb_memory_view_parse_item_format again
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
|
|
And `-w` option turns it on.
Notes:
Merged: https://github.com/ruby/ruby/pull/3481
|
|
refinement"
This reverts commit eeef16e190cdabc2ba474622720f8e3df7bac43b.
This also reverts the spec change.
Preventing the SystemStackError would be nice, but there is valid
code that the fix breaks, and it is probably more common than cases
that cause the SystemStackError.
Fixes [Bug #17182]
Notes:
Merged: https://github.com/ruby/ruby/pull/3564
|
|
This sets an explicit default of nil. There is probably a better
approach of removing the default.
Fixes [Bug #17181]
Notes:
Merged: https://github.com/ruby/ruby/pull/3563
|
|
Fixes [Bug #17172].
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
|
|
literals
* That is, for plain string literals, not interpolated.
* The test below is very similar and uses the same check.
|
|
This reverts commit 889bbbaf527372c5cc229b56dca9a2322e325f26.
|
|
9b535f3ff7 does not support ISeq#to_binary.
To make CI green, skip this test temporarily.
Please fix this issue and revert this patch.
|
|
* Remove freezestring instruction since this was the only usage for it.
* [Feature #17104]
Notes:
Merged: https://github.com/ruby/ruby/pull/3488
|
|
Returns `nil` instead of an empty string when non-integer number is given (to make it 2.7 compatible).
Notes:
Merged-By: soutaro <matsumoto@soutaro.com>
|
|
Start with https://github.com/ruby/ruby/commit/fa21985a7a2f8f52a8bd82bd12a724e9dca74934
to https://github.com/ruby/ruby/commit/d7492a0be885ea9f2b9f71e3e95582f9a859c439
|
|
A backtrace object in an exception had never supported marshalling
correctly: `Marshal.load(Marshal.dump(exc)).backtrace_locations` dumped
core.
An Exception object has two hidden instance varibles for backtrace data:
one is "bt", which has an Array of Strings, and the other is
"bt_locations", which has an Array of Thread::Backtrace::Locations.
However, Exception's dump outputs data so that the two variables are the
same Array of Strings. Thus, "bt_locations" had a wrong-type object.
For the compatibility, it is difficult to change the dump format. This
changeset fixes the issue by ignoring data for "bt_locations" at the
loading phase if "bt_locations" refers to the same object as "bt".
Future work: Exception's dump should output "bt_locations"
appropriately.
https://bugs.ruby-lang.org/issues/17150
Notes:
Merged: https://github.com/ruby/ruby/pull/3521
|
|
https://bugs.ruby-lang.org/issues/16150#change-87446
Notes:
Merged: https://github.com/ruby/ruby/pull/3514
Merged-By: nobu <nobu@ruby-lang.org>
|
|
PR https://github.com/ruby/ruby/pull/3418 added a category to
`rb_warn_deprecated_to_remove` but not to `rb_warn_deprecated`. This
adds the same code to `rb_warn_deprecated` so that those warnings also
get a category.
This change also adds tests for `rb_warn_deprecated` and updates the
tests for `rb_warn_deprecated_to_remove` to have clearer names.
I've fixed the call to `rb_method_entry` as we need to be using the
instance method, not singleton.
Feature: https://bugs.ruby-lang.org/issues/17122
Notes:
Merged: https://github.com/ruby/ruby/pull/3505
|
|
Fixes [Bug #14895]
Notes:
Merged: https://github.com/ruby/ruby/pull/3502
|
|
end" (tests)
Reverted in e080a4cdee
Notes:
Merged: https://github.com/ruby/ruby/pull/3501
|
|
This change adds a `category` kwarg to make it easier to monkey patch
`Warning.warn`. Warnings already have a category, but that warning isn't
exposed. This implements a way to get the category so that warnings with
a specific category, like deprecated, can be treated differently than
other warnings in an application.
The change here does an arity check on the method to support backwards
compatibility for applications that may already have a warning monkey
patch.
For our usecase we want to `raise` for deprecation warnings in order to
get the behavior for the next Ruby version. For example, now that we
fixed all our warnings and deployed Ruby 2.7 to production, we want to
be able to have deprecation warnings behave like they would in 3.0: raise
an error. For other warnings, like uninialized constants, that behavior
won't be removed from Ruby in the next version, so we don't need to
raise errors.
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/3418
|
|
non-integer end"
This reverts commit 8900a25581822759daca528d46a75e0b743fc22e.
Notes:
Merged: https://github.com/ruby/ruby/pull/3500
|
|
This reverts commit 05bf811c2839628aaef3d565daedb28be80d47ef.
Notes:
Merged: https://github.com/ruby/ruby/pull/3500
|
|
https://bugs.ruby-lang.org/issues/16746#note-26
Notes:
Merged: https://github.com/ruby/ruby/pull/3479
|
|
https://bugs.ruby-lang.org/issues/6670#change-75907
|
|
automatically
|
|
Previously, Method#super_method looked at the called_id to
determine the method id to use, but that isn't correct for
aliased methods, because the super target depends on the
original method id, not the called_id.
Additionally, aliases can reference methods defined in other
classes and modules, and super lookup needs to start in the
super of the defined class in such cases.
This adds tests for Method#super_method for both types of
aliases, one that uses VM_METHOD_TYPE_ALIAS and another that
does not. Both check that the results for calling super
methods return the expected values.
To find the defined class for alias methods, add an rb_ prefix
to find_defined_class_by_owner in vm_insnhelper.c and make it
non-static, so that it can be called from method_super_method
in proc.c.
This bug was original discovered while researching [Bug #11189].
Fixes [Bug #17130]
Notes:
Merged: https://github.com/ruby/ruby/pull/3458
Merged-By: jeremyevans <code@jeremyevans.net>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3460
|
|
|
|
If the passed string is frozen, bare and not shared, then there
is no need to duplicate it.
Ref: 4ab69ebbd7cef8539f687e1f948845d076461dc6
Ref: https://bugs.ruby-lang.org/issues/11386
Notes:
Merged: https://github.com/ruby/ruby/pull/3430
|
|
As well as the other places using RCLASS_IV_INDEX_TBL.
`IO#reopen` seems the only case that the class of an object can be
changed.
|
|
When the pattern Regexp given to String#index and String#rindex
contain a /\K/ (lookbehind) operator, these methods return the
position where the beginning of the lookbehind pattern matches, while
they are expected to return the position where the \K matches.
```
# without patch
"abcdbce".index(/b\Kc/) # => 1
"abcdbce".rindex(/b\Kc/) # => 4
```
This patch fixes this problem by using BEG(0) instead of the return
value of rb_reg_search.
```
# with patch
"abcdbce".index(/b\Kc/) # => 2
"abcdbce".rindex(/b\Kc/) # => 5
```
Fixes [Bug #17118]
Notes:
Merged: https://github.com/ruby/ruby/pull/3414
|
|
When the pattern given to String#partition and String#rpartition
contain a /\K/ (lookbehind) operator, the methods return strings
sliced at incorrect positions.
```
# without patch
"abcdbce".partition(/b\Kc/) # => ["a", "c", "cdbce"]
"abcdbce".rpartition(/b\Kc/) # => ["abcd", "c", "ce"]
```
This patch fixes the problem by using BEG(0) instead of the return
value of rb_reg_search.
```
# with patch
"abcdbce".partition(/b\Kc/) # => ["ab", "c", "dbce"]
"abcdbce".rpartition(/b\Kc/) # => ["abcdb", "c", "e"]
```
As a side-effect this patch makes String#partition 2x faster when the
pattern is a costly Regexp by performing Regexp search only once,
which was unexpectedly done twice in the original implementation.
Fixes [Bug #17119]
Notes:
Merged: https://github.com/ruby/ruby/pull/3413
|
|
Extension string stored in `ARGF.inplace` is created using an api
designed for C string constants to create a Ruby string that
points at another Ruby string. When the original string is swept,
the extension string gets corrupted.
Reproduction script (on MacOS):
```ruby
#!/usr/bin/ruby -pi.bak
BEGIN {
GC.start(full_mark: true)
arr = []
1000000.times do |x|
arr << "fooo#{x}"
end
}
puts "hello"
```
Co-Authored-By: Matt Valentine-House <31869+eightbitraptor@users.noreply.github.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/3409
Merged-By: nobu <nobu@ruby-lang.org>
|
|
Use BEG(0) instead of the result of rb_reg_search to handle the cases
when the separator Regexp contains /\K/ (lookbehind) operator.
Fixes [Bug #17113]
Notes:
Merged: https://github.com/ruby/ruby/pull/3407
|