Commit graph

16692 commits

Author SHA1 Message Date
Koichi Sasada
308fe1eb85 Do not create core file if it is intentional abort
Two tests abort intentionally and they create core files if
possible. In these case, we don't need to see core files
so disable by `"Process.setrlimit(Process::RLIMIT_CORE, 0)` for
those cases.
2022-01-19 23:17:14 +09:00
Nobuyoshi Nakada
d650b17686
rb_fiber_terminate must not return [Bug #18497]
In a forked process from a fiber, the fiber becomes the only
fiber, `fiber_switch` does nothing as there is no other fibers,
`rb_fiber_terminate` does not terminate the fiber.  In that case,
reaches the end of `fiber_entry` finaly, which is declared as
"COROUTINE" and should never return.
2022-01-19 19:57:16 +09:00
Nobuyoshi Nakada
5c7af72304
Assuming EXIT_SUCCESS equals 0 is not portable 2022-01-19 19:57:16 +09:00
David Rodríguez
0350c179ea [rubygems/rubygems] Don't pass regexp to Gem::Dependeny.new from list, search, and query commands
It's deprecated functionality.

13d3eb6cb0
2022-01-19 15:56:35 +09:00
Hiroshi SHIBATA
d22511fd75 Merge rubygems/rubygems HEAD.
Picked at 12aeef6ba9a3be0022be9934c1a3e4c46a03ed3a
2022-01-19 15:01:44 +09:00
Yusuke Endoh
68e821c3e5 test/ruby/test_assignment.rb: Prevent a warning
```
/home/chkbuild/chkbuild/tmp/build/20220119T003004Z/ruby/test/ruby/test_assignment.rb:727: warning: assigned but unused variable - m
```
20220119T003004Z.log.html.gz
2022-01-19 13:15:37 +09:00
David Rodríguez
f04954d95c
[rubygems/rubygems] Normalize end alignment style with Bundler
f7f504b24c
2022-01-19 11:20:36 +09:00
Takashi Kokubun
c0d18a1aa2
[ruby/erb] Revert "Remove safe_level and further positional arguments (https://github.com/ruby/erb/pull/7)"
This reverts commit 5133efa06f.

While we already handled this deprecation in many libraries, we noticed
that some (e.g. sprockets) relied on the format of `ERB.version` and
2b4182eb10 broke such handling.

Given that the `ERB.version` change was released at 3.1 and it's
obviously new, I'll skip this removal in 3.2 and postpone this to a
future version.
2022-01-17 12:39:17 -08:00
Nobuyoshi Nakada
f3c77bd480 Fix the placeholder subclass entry skipping [Bug #18489] 2022-01-17 21:23:40 +09:00
Kazuhiro NISHIYAMA
549af505c5 [ruby/net-http] Remove redundant MJIT condition
ref da0f67c038

dbeb5f1c8f
2022-01-17 17:11:27 +09:00
Nobuyoshi Nakada
4cd6fd338f
Weakmap failure is still pending 2022-01-16 22:43:04 +09:00
aycabta
1550756849 [ruby/reline] Use "Bundler.require" to load Gemfile.lock in multiline_repl
492bee257a
2022-01-16 22:09:32 +09:00
aycabta
f5e3913737 [ruby/reline] Fix incremental search to work correctly even if not last line
21d75f6d4c
2022-01-16 22:09:31 +09:00
aycabta
921ff739df [ruby/reline] Insert newline in the middle of buffer just after dialog
0c76631132
2022-01-16 22:09:31 +09:00
aycabta
d1e078e71c [ruby/reline] Add a wait for a test because sometimes fails
da4a7aa932
2022-01-16 22:09:30 +09:00
aycabta
f94a2adf6a [ruby/reline] Clear dialog when adding new line to end of buffer
7d38454327
2022-01-16 22:09:28 +09:00
Nobuyoshi Nakada
5ec3450438 Remove outdated skips 2022-01-16 21:35:09 +09:00
Nobuyoshi Nakada
a4a7bf2a63 Use pend for old TODOs 2022-01-16 21:35:09 +09:00
Takashi Kokubun
d12a08abb5 [ruby/erb] Remove safe_level and further positional arguments (https://github.com/ruby/erb/pull/7)
[Feature #14256]

5133efa06f
2022-01-16 06:46:47 +09:00
loadkpi
7c70151aed [rubygems/rubygems] Fix gem update --system for already installed version of rubygems-update
c167d513a7
2022-01-15 14:00:35 +09:00
Jeremy Evans
58dc8bf8f1 Fix {Method,UnboundMethod}#{public?,private?,protected?} for ZSUPER methods
Add a visibility member to struct METHOD storing the original
method visibility, and use that, instead of taking the visibility
from the stored method entry (which may have different visibility
for ZSUPER methods).

Consider Method/UnboundMethod objects different if they have
different visibilities.

Fixes [Bug #18435]
2022-01-14 13:46:18 -08:00
Jeremy Evans
a93cc3e23b Make Hash#shift return nil for empty hash
Fixes [Bug #16908]
2022-01-14 12:17:57 -08:00
Jeremy Evans
ca3d405242 Fix constant assignment evaluation order
Previously, the right hand side was always evaluated before the
left hand side for constant assignments.  For the following:

```ruby
lhs::C = rhs
```

rhs was evaluated before lhs, which is inconsistant with attribute
assignment (lhs.m = rhs), and apparently also does not conform to
JIS 3017:2013 11.4.2.2.3.

Fix this by changing evaluation order.  Previously, the above
compiled to:

```
0000 putself                                                          (   1)[Li]
0001 opt_send_without_block                 <calldata!mid:rhs, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0003 dup
0004 putself
0005 opt_send_without_block                 <calldata!mid:lhs, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0007 setconstant                            :C
0009 leave
```

After this change:

```
0000 putself                                                          (   1)[Li]
0001 opt_send_without_block                 <calldata!mid:lhs, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0003 putself
0004 opt_send_without_block                 <calldata!mid:rhs, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0006 swap
0007 topn                                   1
0009 swap
0010 setconstant                            :C
0012 leave
```

Note that if expr is not a module/class, then a TypeError is not
raised until after the evaluation of rhs.  This is because that
error is raised by setconstant.  If we wanted to raise TypeError
before evaluation of rhs, we would have to add a VM instruction
for calling vm_check_if_namespace.

Changing assignment order for single assignments caused problems
in the multiple assignment code, revealing that the issue also
affected multiple assignment.  Fix the multiple assignment code
so left-to-right evaluation also works for constant assignments.

Do some refactoring of the multiple assignment code to reduce
duplication after adding support for constants. Rename struct
masgn_attrasgn to masgn_lhs_node, since it now handles both
constants and attributes. Add add_masgn_lhs_node static function
for adding data for lhs attribute and constant setting.

Fixes [Bug #15928]
2022-01-14 11:00:26 -08:00
David Rodríguez
7d42b442bb [rubygems/rubygems] Support binstubs with --enable-load-relative prolog
32a5e9057a
2022-01-15 00:00:11 +09:00
David Rodríguez
3006451f65 [rubygems/rubygems] Privatize some test utils
386b3b85ca
2022-01-15 00:00:09 +09:00
Benoit Daloze
da0f67c038 [rubygems/rubygems] Remove redundant condition
See https://github.com/rubygems/rubygems/pull/5210#discussion_r784807168

cd0e961e81
2022-01-14 23:38:09 +09:00
Jean Boussier
8d05047d72 Add a Module#const_added callback
[Feature #17881]

Works similarly to `method_added` but for constants.

```ruby
Foo::BAR = 42 # call Foo.const_added(:FOO)
class Foo::Baz; end # call Foo.const_added(:Baz)
Foo.autoload(:Something, "path") # call Foo.const_added(:Something)
```
2022-01-14 11:30:07 +01:00
Kazuhiro NISHIYAMA
b9b6377401 [ruby/net-http] Fix unescaped . in Regexp
Use `include?` instead.

05022744a9
2022-01-14 08:16:37 +09:00
Akira Matsuda
9828502570 [rubygems/rubygems] Let Version#spaceship accept a String
With this patch, handwriting version comparisons become a little bit easier.

before:
  SomeGem.version <=> Gem::Version.new('1.3')

after:
  SomeGem.version <=> '1.3'

7e0dbb79f2
2022-01-13 18:15:14 +09:00
Koichi Sasada
7e21b77dc6 T#dup (T < Proc) should return T's object
T#dup (T < Proc) returns Proc object (not T) from Ruby 1.9.
[Bug #17545]
2022-01-13 17:43:14 +09:00
Yusuke Endoh
ae5458f228 thread.c: Convert TAG_BREAK to a normal exception at thread top-level
[Bug #18475]
2022-01-13 03:21:45 +09:00
Peter Zhu
2d81a718ec Make embedded string length a long for VWA
A short (2 bytes) will cause unaligned struct accesses when strings are
used as a buffer to directly store binary data.
2022-01-12 12:00:55 -05:00
Nobuyoshi Nakada
e28dbd0f3d
[ruby/optparse] Fix for ruby 3.0 or earlier
9e29d86c12
2022-01-12 21:16:02 +09:00
Nobuyoshi Nakada
743a41f7e3
[ruby/optparse] DidYouMean::PlainFormatter is deprecated
0ac9957696
2022-01-12 21:16:02 +09:00
Hiroshi SHIBATA
dcb02cb28a
[ruby/io-nonblock] Use omit instead of skip for test-unit
a7bfbfa049
2022-01-12 11:02:24 +09:00
Hiroshi SHIBATA
186fd89086 [ruby/rinda] Use omit instead of skip for test-unit
1d3512aa26
2022-01-12 10:59:21 +09:00
Hiroshi SHIBATA
bf2bd6dc22 [ruby/io-wait] Use omit instead of skip for test-unit
75543ab1bc
2022-01-12 10:53:57 +09:00
Hiroshi SHIBATA
7f5e06601b [ruby/date] Use omit instead of skip for test-unit
537f3f681e
2022-01-12 10:53:34 +09:00
Hiroshi SHIBATA
236678b823 [ruby/open3] Use omit instead of skip for test-unit
f6ca124b56
2022-01-12 10:52:09 +09:00
Hiroshi SHIBATA
8ccbca2623 [ruby/win32ole] Use omit() for skip()
2d5dc47ed4
2022-01-12 10:50:43 +09:00
Hiroshi SHIBATA
5331615d54 [ruby/win32ole] Use omit instead of skip for test-unit
c0586b2f75
2022-01-12 10:50:41 +09:00
Hiroshi SHIBATA
c02a9994ce [ruby/resolv] Use omit instead of skip for test-unit
55e42221d4
2022-01-12 10:49:58 +09:00
Jeremy Evans
d494a16ac5 [ruby/resolv] Support more characters in link local addresses
Implements [Feature #17524]

993a1a374f
2022-01-12 10:49:57 +09:00
Hiroshi SHIBATA
34ebf82e83 [ruby/tmpdir] Use omit instead of skip for test-unit
40107b59b3
2022-01-11 21:50:53 +09:00
Hiroshi SHIBATA
9b3dcf193c [ruby/net-http] Use omit instead of skip for test-unit
843d4548de
2022-01-11 21:45:34 +09:00
Hiroshi SHIBATA
167121a9e7 [ruby/find] Use omit instead of skip for test-unit
0ebbd5b852
2022-01-11 21:40:51 +09:00
Hiroshi SHIBATA
6b87d98011 [ruby/zlib] Use omit instead of skip for test-unit
5f23cd3009
2022-01-11 21:35:22 +09:00
Hiroshi SHIBATA
f95039af75
Use omit instead of skip without the default gems tests 2022-01-11 21:17:59 +09:00
Nobuyoshi Nakada
1c9b5d452e
Reject command line option ending with - 2022-01-11 11:49:34 +09:00
aycabta
9e79ae539b [ruby/reline] Clear dialog when just_move_cursor is called with dialog at last line
05024b968e
2022-01-11 06:10:37 +09:00