Commit graph

74217 commits

Author SHA1 Message Date
Nobuyoshi Nakada
21fa0135a4
Split tests for Array#shuffle and Array#sample 2022-10-24 23:45:45 +09:00
Burdette Lamar
bcb72f503c
[DOC] Add note about method names (#6620) 2022-10-24 08:56:13 -05:00
st0012
5a86155249 [ruby/irb] Add a test case to cover rdoc unintalled scenario 2022-10-24 13:36:58 +00:00
st0012
b7622d792d [ruby/irb] Move require out of repeated execution path
SHOW_DOC_DIALOG will be called repeatedly whenever the corresponding key
is pressed, but we only need to require rdoc once. So ideally the
require can be put outside of the proc.

And because when rdoc is not available the entire proc will be
nonfunctional, we can stop registering the SHOW_DOC_DIALOG if we failed
to require rdoc.

b1278b7320
2022-10-24 13:36:57 +00:00
st0012
d377cc4530 [ruby/irb] Add tests for RelineInputMethod 2022-10-24 13:36:56 +00:00
Nobuyoshi Nakada
6cca8a0ceb
Strip trailing spaces [ci skip] 2022-10-24 18:38:09 +09:00
git
c7a5ca999e * remove trailing spaces. [ci skip] 2022-10-24 09:28:07 +00:00
git
399747926c Update bundled gems list at 2022-10-24 2022-10-24 09:27:55 +00:00
Yusuke Endoh
67ed70da61 Refactor timeout-setting code to a function 2022-10-24 18:21:30 +09:00
Yusuke Endoh
ef01482f64 Refactor timeout-related code in re.c a little 2022-10-24 18:13:26 +09:00
Nobuyoshi Nakada
8873c420d3
Fix error when commit hash is removed [ci skip] 2022-10-24 18:12:25 +09:00
Yusuke Endoh
b51b22513f
Fix per-instance Regexp timeout (#6621)
Fix per-instance Regexp timeout

This makes it follow what was decided in [Bug #19055]:

* `Regexp.new(str, timeout: nil)` should respect the global timeout
* `Regexp.new(str, timeout: huge_val)` should use the maximum value that
  can be represented in the internal representation
* `Regexp.new(str, timeout: 0 or negative value)` should raise an error
2022-10-24 18:03:26 +09:00
Nobuyoshi Nakada
6700fa7f62
Set timestamp path for the target path to TARGET_SO_DIR_TIMESTAMP 2022-10-24 17:48:00 +09:00
Nobuyoshi Nakada
711b2ed5fe
Make the timestamp path correspond to the bundled target path
So different timestamps for different paths will be used.  Extentions
paths in bundled gems contain `ruby_version`, which includes the ABI
version, and the same timestamp file for different paths resulted in
build failures when it changed.
2022-10-24 17:47:59 +09:00
Nobuyoshi Nakada
3af373285b
Adjust indents [ci skip] 2022-10-24 17:42:29 +09:00
S-H-GAMELINKS
298221dfe5 Reuse RBOOL macro in rb_ivar_defined function 2022-10-24 10:25:01 +02:00
git
87f432b675 Update default gems list at c5f5403f6e [ci skip] 2022-10-24 05:46:26 +00:00
Hiroshi SHIBATA
c5f5403f6e [ruby/net-http] Bump version to 0.3.0 2022-10-24 05:45:44 +00:00
Nobuyoshi Nakada
174ddc79c5
Skip File.atime/File.mtime tests randomly failing on Travis
Not only powerpc64le, also s390x and arm32 seem failing too.  These
failures are probably caused by filesystem settings on Travis, but
unrelated to CPUs.
2022-10-24 09:32:13 +09:00
Nobuyoshi Nakada
c3e37f74ae
Adjust indents [ci skip] 2022-10-24 00:22:37 +09:00
S-H-GAMELINKS
c4089e6524 Fix argument & Remove enum 2022-10-23 17:38:59 +09:00
S-H-GAMELINKS
1e06ef1328 Introduce rb_memsearch_with_char_size function 2022-10-23 17:38:59 +09:00
Nobuyoshi Nakada
86450d03a8 Reduce type check of arguments at Complex creation 2022-10-23 16:44:43 +09:00
S.H
c8c136265c
Introduce hash_iter_status_check function 2022-10-23 16:17:24 +09:00
Stephen Ierodiaconou
54cad3123a
[Bug #19004] Complex.polar handles complex singular abs argument
`Complex.polar` accepts Complex values as arguments for the polar form as long
as the value of the complex has no imaginary part (ie it is 'real'). In
`f_complex_polar` this is handled by extracting the real part of the arguments.
However in the case `polar` is called with only a single argument, the absolute
value (abs), then the Complex is created without applying a check on the type
of abs, meaning it is possible to create a Complex where the real part is itself
an instance of a Complex. This change removes the short circuit for the single
argument case meaning the real part extraction is performed correctly
(by f_complex_polar).

Also adds an example to `spec/ruby/core/complex/polar_spec.rb` to check that
the real part of a complex argument is correctly extracted and used in the
resulting Complex real and imaginary parts.
2022-10-23 12:59:06 +09:00
Nobuyoshi Nakada
0d9628e0de
Update Complex.polar with Complex tests 2022-10-23 12:46:13 +09:00
Samuel Williams
8dfe3bdf48
Improved formatting of hash_foreach_iter functions. (#6615) 2022-10-22 23:34:00 +13:00
Thomas E. Enebo
420bdba139 [rubygems/rubygems] Allow upcoming JRuby to pass keywords for Kernel#warn
jruby-head (which will be JRuby 9.4.0.0) can now properly process
the keywords to Kernel#warn.  I cannot think of any capability based
test for this so I constrained it using a version guard.  Only JRuby
will ever hit the version guard.

cd468c7e0f
2022-10-22 08:01:24 +00:00
yui-knk
0d697e341a Add [Feature #19013] to NEWS [ci skip] 2022-10-22 16:46:27 +09:00
Jemma Issroff
a11952dac1 Rename iv_count on shapes to next_iv_index
`iv_count` is a misleading name because when IVs are unset, the new
shape doesn't decrement this value. `next_iv_count` is an accurate, and
more descriptive name.
2022-10-21 14:57:34 -07:00
Jemma Issroff
13bd617ea6 Remove unused class serial
Before object shapes, we were using class serial to invalidate
inline caches. Now that we use shape_id for inline cache keys,
the class serial is unnecessary.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-10-21 14:56:48 -07:00
Alan Wu
87bb0bee6b
YJIT: Fix page rounding for icache busting
Previously, we found the current page by rounding the current pointer to
the closest smaller page size. This is incorrect because pages are
relative to the start of the address we reserve. For example, if the
starting address is 12KiB modulo the 16KiB page size, once we have more
than 4KiB of code, calculating with the address would incorrectly give
us page 1 when we're actually still on page 0.

Previously, I can reproduce crashes with:

    make btest RUN_OPTS=--yjit-code-page-size=32

on ARM64 macOS, where system page sizes are 16KiB.
2022-10-21 17:06:34 -04:00
Alan Wu
8bbcb75377 YJIT: Read rb_num_t as usize early
This patch makes sure that we're not accidentally reading rb_num_t
instruction arguments as VALUE and accidentally baking them into
code and marking them. Some of these are simply moving the cast earlier,
but some of these avoid potential problems for flag and ID arguments.

Follow-up for 39f7eddec4.
2022-10-21 16:25:41 -04:00
Burdette Lamar
c7754a4d4c
[DOC] Add link targets (#6602) 2022-10-21 14:42:28 -05:00
Jemma Issroff
f2ae58119d In init_copy, set shape after copying ivars
GC uses shapes to determine IV buffer width. Since allocation can
trigger GC, we need to ensure we only set the shape once we've fully
allocated new memory for the IV buffer, otherwise the GC can end up
trying to mark invalid memory.
2022-10-21 10:57:05 -07:00
Burdette Lamar
35e03a44b8 [ruby/stringio] [DOC] Enhanced RDoc for StringIO
(https://github.com/ruby/stringio/pull/36)

Treats:
- #each_codepoint
- #gets
- #readline (shows up in doc for module IO::generic_readable, not class
StringIO)
- #each_line

659aca7fe5
2022-10-21 14:12:45 +00:00
Hiroshi SHIBATA
f88bff7705 [ruby/net-http] Revert "Replace Timeout.timeout in Net:HTTP#connect"
This reverts commit 753cae3bbc.

98caa38204
2022-10-21 12:39:52 +00:00
Yusuke Endoh
e026368061 Range#size returns nil for (.."a") and (nil..)
Fixes [Bug #18983]
2022-10-21 16:35:46 +09:00
Nobuyoshi Nakada
e72c5044ce
Check writebarrier arguments only when RGENGC_CHECK_MODE [ci skip]
The commit 575ae50d16 was for debugging
the failure triggered by f55212bce9, and
it was fixed at the commit 39f7eddec4.
2022-10-21 10:02:16 +09:00
Alan Wu
39f7eddec4 YJIT: Fix gen_expandarray treating argument as VALUE
The expandarray instruction interpreters its arguments as rb_num_t.
YJIT was treating the num argument as a VALUE previously and when
it has a certain bit pattern, it can look like a GC pointer. The
argument is not a pointer, so YJIT crashed when trying to mark those
pointers.

This bug existed previously, but our test suite didn't expose it until
f55212bce9. TestArgf#test_to_io has a
line like:

    a1, a2, a3, a4, a5, a6, a7, a8 = array

Which maps to an expandarray with an argument of 8. Qnil happened to
be defined as 8, which masked the issue.

Fix it by not using the argument as a VALUE.
2022-10-20 18:12:15 -04:00
Alan Wu
2930302244
YJIT: remove some stale comments [ci skip] 2022-10-20 17:17:00 -04:00
Nobuyoshi Nakada
9a0a165a5d Check writebarrier arguments 2022-10-20 15:43:34 -04:00
Nobuyoshi Nakada
245ad2b38a YJIT: incorporate ruby_special_consts 2022-10-20 15:43:34 -04:00
Jemma Issroff
6aed5b0c11 Unmark Internal IV test as pending
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-10-20 11:59:34 -07:00
Ufuk Kayserilioglu
0378e2f4a8 Add Class#attached_object
Implements [Feature #12084]

Returns the object for which the receiver is the singleton class, or
raises TypeError if the receiver is not a singleton class.
2022-10-20 17:30:17 +02:00
Nobuyoshi Nakada
192bc72529 Define UNDEF_P and NIL_OR_UNDEF_P [EXPERIMENTAL] 2022-10-20 22:05:27 +09:00
Nobuyoshi Nakada
f55212bce9 Move "special consts" so Qundef and Qnil differ just 1 bit 2022-10-20 22:05:27 +09:00
Nobuyoshi Nakada
1e66d3b853
Ignore manual files only commits [ci skip] 2022-10-20 21:58:06 +09:00
Koichi Sasada
e35c528d72 push dummy frame for loading process
This patch pushes dummy frames when loading code for the
profiling purpose.

The following methods push a dummy frame:
* `Kernel#require`
* `Kernel#load`
* `RubyVM::InstructionSequence.compile_file`
* `RubyVM::InstructionSequence.load_from_binary`

https://bugs.ruby-lang.org/issues/18559
2022-10-20 17:38:28 +09:00
Nobuyoshi Nakada
7563604fb8 [Bug #18998] Honor #to_str next to #to_int in Kernel#Integer 2022-10-20 15:35:31 +09:00