| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
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
|
|
|
| |
https://bugs.ruby-lang.org/issues/16150#change-87446
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Fixes [Bug #14895]
|
|
|
|
|
|
| |
end" (tests)
Reverted in e080a4cdee
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
non-integer end"
This reverts commit 8900a25581822759daca528d46a75e0b743fc22e.
|
|
|
|
| |
This reverts commit 05bf811c2839628aaef3d565daedb28be80d47ef.
|
|
|
|
| |
https://bugs.ruby-lang.org/issues/16746#note-26
|
|
|
|
| |
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]
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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]
|
| |
|
|
|
|
|
|
|
|
|
| |
* Fix debug documents to match Thread#to_s change (Feature #16412 ticket)
* TracePoint#inspect returns "... file:line" (Feature #16513)
* Guard older version of Ruby in Tracepoint inspection tests
* Focus on current thread only when running TracePoint inspection test
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes [Bug #17025]
|
|
|
|
|
|
|
|
|
| |
Without this, if a refinement defines a method that calls super and
includes a module with a module that calls super and has a activated
refinement at the point super is called, the module method super call
will end up calling back into the refinement method, creating a loop.
Fixes [Bug #17007]
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
| |compare-ruby|built-ruby|
|:-------|-----------:|---------:|
|num3 | 96.333k| 160.732k|
| | -| 1.67x|
|num10 | 96.615k| 159.150k|
| | -| 1.65x|
|ary2 | 103.836k| 172.787k|
| | -| 1.66x|
|ary10 | 109.249k| 177.252k|
| | -| 1.62x|
|ary20 | 106.628k| 177.371k|
| | -| 1.66x|
|ary50 | 107.135k| 162.282k|
| | -| 1.51x|
|ary100 | 106.513k| 177.626k|
| | -| 1.67x|
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Popular Ruby libraries such as Rails and Rubocop relying on the
previous behavior, even though it is technically a bug. The
correct behavior is probably raising RangeError, since that is what
an endless range raises.
Related to [Bug #17017]
|
|
|
|
|
|
|
|
|
| |
* Fix Range#max for beginless Integer ranges
* Update test/ruby/test_range.rb
* Fix formatting
https://github.com/ruby/ruby/pull/3328
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The benchmark result is below:
| |compare-ruby|built-ruby|
|:---------------|-----------:|---------:|
|ary2.min | 39.105M| 39.442M|
| | -| 1.01x|
|ary10.min | 23.995M| 30.762M|
| | -| 1.28x|
|ary100.min | 6.249M| 10.783M|
| | -| 1.73x|
|ary500.min | 1.408M| 2.714M|
| | -| 1.93x|
|ary1000.min | 828.397k| 1.465M|
| | -| 1.77x|
|ary2000.min | 332.256k| 570.504k|
| | -| 1.72x|
|ary3000.min | 338.079k| 573.868k|
| | -| 1.70x|
|ary5000.min | 168.217k| 286.114k|
| | -| 1.70x|
|ary10000.min | 85.512k| 143.551k|
| | -| 1.68x|
|ary20000.min | 43.264k| 71.935k|
| | -| 1.66x|
|ary50000.min | 17.317k| 29.107k|
| | -| 1.68x|
|ary100000.min | 9.072k| 14.540k|
| | -| 1.60x|
|ary1000000.min | 872.930| 1.436k|
| | -| 1.64x|
compare-ruby is 9f4b7fc82e.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The benchmark result is below:
| |compare-ruby|built-ruby|
|:---------------|-----------:|---------:|
|ary2.max | 38.837M| 40.830M|
| | -| 1.05x|
|ary10.max | 23.035M| 32.626M|
| | -| 1.42x|
|ary100.max | 5.490M| 11.020M|
| | -| 2.01x|
|ary500.max | 1.324M| 2.679M|
| | -| 2.02x|
|ary1000.max | 699.167k| 1.403M|
| | -| 2.01x|
|ary2000.max | 284.321k| 570.446k|
| | -| 2.01x|
|ary3000.max | 282.613k| 571.683k|
| | -| 2.02x|
|ary5000.max | 145.120k| 285.546k|
| | -| 1.97x|
|ary10000.max | 72.102k| 142.831k|
| | -| 1.98x|
|ary20000.max | 36.065k| 72.077k|
| | -| 2.00x|
|ary50000.max | 14.343k| 29.139k|
| | -| 2.03x|
|ary100000.max | 7.586k| 14.472k|
| | -| 1.91x|
|ary1000000.max | 726.915| 1.495k|
| | -| 2.06x|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, for inclusive ranges, the max would show up as the
end of the range, even though the end was not an integer and would
not be the maximum value. For exclusive ranges, max/minmax would
previously raise a TypeError, even though it is possible to get the
correct maximum.
This change to max/minmax also uncovered a similar error in cover?,
which calls max in certain cases, so adjust the code there so that
cover? still works as expected.
Fixes [Bug #17017]
|
| |
|
|
|
|
| |
Fixes [Bug #16922]
|
| |
|
|
|
|
|
|
|
|
| |
which is checked by the first guard. When JIT-inlined cc and operand
cd->cc are different, the JIT-ed code might wrongly dispatch cd->cc even
while class check is done with another cc inlined by JIT.
This fixes SEGV on railsbench.
|
|
|
|
| |
`RubyVM::AbstractSyntaxTree`.
|
| |
|
|
|
|
|
|
| |
Fix CI failure like
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3043247
introduced by a69dd699ee630dd1086627dbca15a218a8538b6f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The implementation of Range#minmax added in d5c60214c45 causes the
following incorrect behaviour:
('a'...'c').minmax => ["a", ["a", "b"]]
instead of
('a'...'c').minmax => ["a", "b"]
This is because the C implementation of Range#minmax (range_minmax)
directly delegates to the C implementation of Range#min (range_min) and
Range#max (range_max), without changing the execution context.
Range#max's C implementation (range_max), when given a non-numeric
exclusive range, delegates to super, which is meant to call
Enumerable#max. However, because range_max is called directly by
range_minmax, super calls Enumerable#minmax instead, causing the
incorrect nesting.
Perhaps it is possible to change the execution context in an optimized
manner, but the simplest solution seems to be to just explicitly
delegate from Range#minmax to Range#min and Range#max.
|
|
|
|
|
| |
* Make Kernel#then, #yield_self, #frozen? builtin
* Fix test_jit
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Rewrite Kernel#tap with Ruby
This was good for VM too, but of course my intention is to unblock JIT's inlining of a block over yield
(inlining invokeyield has not been committed though).
* Fix test_settracefunc
About the :tap deletions, the :tap events are actually traced (we already have a TracePoint test for builtin methods),
but it's filtered out by tp.path == "xyzzy" (it became "<internal:kernel>"). We could trace tp.path == "<internal:kernel>"
cases too, but the lineno is impacted by kernel.rb changes and I didn't want to make it fragile for kernel.rb lineno changes.
|
| |
|