Commit graph

16449 commits

Author SHA1 Message Date
John Hawthorn
073e3b2eab Add test for recursion 2021-10-20 18:19:37 -04:00
John Hawthorn
7ed1e3ff0b Add test of yjit compilation 2021-10-20 18:19:37 -04:00
Maxime Chevalier-Boisvert
d2d564be1d Moved ujit code invalidation test into bootstraptest 2021-10-20 18:19:28 -04:00
Alan Wu
188c54428c MicroJIT: avoid having to invalidate running output code 2021-10-20 18:19:26 -04:00
Jeremy Evans
fac2c0f73c
Fix evaluation order of hash values for duplicate keys
Fixes [Bug #17719]

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Ivo Anjo <ivo@ivoanjo.me>
2021-10-18 09:09:07 -07:00
Kazuki Yamaguchi
cc8ff8b50d [ruby/openssl] require Ruby 2.6 or later
Drop support for Ruby 2.3, 2.4, and 2.5.

As of 2021-10, Ruby 2.6 is the oldest version that still receives
security fixes from the Ruby core team, so it doesn't make much sense
to keep code for those ancient versions.

3436bd040d
2021-10-16 19:39:13 +09:00
Kazuki Yamaguchi
e36906f9ab [ruby/openssl] test/openssl/test_ssl: use TLS 1.2 for finished_messages on LibreSSL
LibreSSL 2.2.x has a bug in the Finished message handling with TLS 1.3.
This is fixed by LibreSSL 3.3.2.

0bea59d245
2021-10-16 18:34:35 +09:00
Nobuhiro IMAI
f88401f38e [ruby/openssl] fix segv in Timestamp::{Request,Response,TokenInfo}.new
prevent `ossl_ts_*_free()` from calling when `d2i_TS_*_bio()` failed.

b29e215786
2021-10-16 18:34:35 +09:00
Nobuyoshi Nakada
ed7ea35d74 [ruby/openssl] Fixed misspellings
[ This is a backport to the 2.1 branch. ]

Fixed misspellings reported at [Bug #16437], for default gems.

(cherry picked from commit ruby/ruby@e68999c82c)

0f43789503
2021-10-16 18:25:11 +09:00
Kazuki Yamaguchi
6105ef7629 [ruby/openssl] ssl: add SSLContext#tmp_dh=
Provide a wrapper of SSL_set0_tmp_dh_pkey()/SSL_CTX_set_tmp_dh(), which
sets the DH parameters used for ephemeral DH key exchange.

SSLContext#tmp_dh_callback= already exists for this purpose, as a
wrapper around SSL_CTX_set_tmp_dh_callback(), but it is considered
obsolete and the OpenSSL API is deprecated for future removal. There is
no practical use case where an application needs to use different DH
parameters nowadays. This was originally introduced to support export
grade ciphers.

RDoc for #tmp_dh_callback= is updated to recommend the new #tmp_dh=.

Note that current versions of OpenSSL support automatic ECDHE curve
selection which is enabled by default. SSLContext#tmp_dh= should only be
necessary if you must allow ancient clients which don't support ECDHE.

aa43da4f04
2021-10-16 18:19:52 +09:00
Mike Dalessio
4ffc3fb019 [ruby/rdoc] fix: alias to method with call-seq
This change fixes alias call-seq to return nil if the method's
call-seq does not specify the alias.

Previously, the alias's call-seq would be an empty string in this case
which broke darkfish rendering.

This change also backfills test coverage for 0ead786 which moved
call-seq deduplication into AnyMethod.

5ce2789b6f
2021-10-16 06:31:11 +09:00
Mike Dalessio
4c42540da2 [ruby/rdoc] Support linking #==
See related commits:

- ebc66662 for #===
- 4943d208 for #[], #[]=, #<<, and #>>

8e47f7840a
2021-10-16 01:40:47 +09:00
Mike Dalessio
7aec65add4 [ruby/rdoc] feat: add support for :category: on C functions
45c92005fe
2021-10-16 01:39:36 +09:00
Mike Dalessio
fbd0516afc [ruby/rdoc] fix: comments in C files use the global markup option
Previously, Parser::C comments all defaulted to "rdoc" format, even
when the user had set a different default with the `--markup=<choice>`
option.

4643b08a26
2021-10-16 01:39:06 +09:00
Mike Dalessio
9225f3c1c6 [ruby/rdoc] test: add coverage for comment format in a C file
3b8334a796
2021-10-16 01:39:04 +09:00
Nobuyoshi Nakada
c19685e208
Reap rarely leaked threads 2021-10-14 22:57:45 +09:00
Nobuyoshi Nakada
a4f2aafd3a [rubygems/rubygems] Remove save_loaded_features
f5e408f83d
2021-10-14 05:03:36 +09:00
Nobuyoshi Nakada
3f0150f2fd [rubygems/rubygems] Keep loaded features
Now `$LOADED_FEATURES` list is being maintained by `setup` and
`teardown` and, only libaries under the temporary directory will
be removed.  As `save_loaded_features` removes the rest libraries
other than this test directory, ordinary libraries loaded from
files under rubygems also removed, and often causes constant
redefinition warnings.

9e1f92aafd
2021-10-14 05:03:36 +09:00
Nobuyoshi Nakada
9a3333986f Add more grpowned? tests 2021-10-14 00:20:13 +09:00
Kaíque Kandy Koga
5c646ca0a0 [ruby/irb] Ignore parenthesis during completion
Rename method

619aecb412
2021-10-13 06:33:48 +09:00
Nobuyoshi Nakada
41db84aa30 [ruby/reline] Skip when unable to set input
`Reline::Windows` always reads from the console by Windows API
 using fiddle.

c3bf85f5af
2021-10-13 02:24:01 +09:00
Nobuyoshi Nakada
97302a362b [ruby/reline] Close working pipes
ac519f57ea
2021-10-12 19:11:56 +09:00
Nobuyoshi Nakada
9f94a07e74 [ruby/reline] Fix test class not to overwrite
1e78984c49
2021-10-11 20:32:34 +09:00
aycabta
990e079b99 [ruby/reline] Reline doesn't have Reline.editing_mode
90c61d8188
2021-10-11 18:43:27 +09:00
aycabta
5895b4a7d9 [ruby/reline] Add I/O test
bca9b9012f
2021-10-11 18:43:27 +09:00
aycabta
5987bcaa2d [ruby/reline] Use single quotes to match the others
58a7ca4101
2021-10-11 18:43:26 +09:00
aycabta
b7ac9a2445 [ruby/reline] Add a test for Reline.delete_text
d1c5700fa3
2021-10-11 18:43:25 +09:00
aycabta
60d20e3537 [ruby/reline] Add assertions for Reline.point
a8c7b207f0
2021-10-11 18:43:25 +09:00
aycabta
706239fcc1 [ruby/reline] Add a test for Reline.insert_text and Reline.line_buffer
ae828208e1
2021-10-11 18:43:24 +09:00
aycabta
340fabca2c [ruby/irb] Set default return_format
7ee15bc668
2021-10-11 15:39:48 +09:00
Takashi Kokubun
82b87a8dc4 [ruby/irb] Clean up a duplicated definition
I simply forgot deleting it.

65399d5e9f
2021-10-11 15:25:05 +09:00
Takashi Kokubun
2e183c6273 [ruby/irb] trufflruby fails on the show_source test
460bd12b87
2021-10-10 23:23:48 -07:00
Takashi Kokubun
b33caa5bbc [ruby/irb] Add a test of find_end for show_source command
68e6ca95a0
2021-10-10 23:23:47 -07:00
aycabta
3112e876a1 [ruby/reline] Add tests for dialog with fullwidth chars and corner cases
35ab5d47a8
2021-10-11 14:10:35 +09:00
Jeremy Evans
9a321dd9b2
[ruby/ipaddr] Make IPAddr#include? consider range of argument
It would be nice to use Range#cover? here, but it doesn't work
correctly before Ruby 2.6. Switch to manual checks of the beginning
of end of the ranges.

Fixes Ruby Bug 14119

f45630da31
2021-10-11 13:50:54 +09:00
Nobuyoshi Nakada
b9f7286fe9
[ruby/io-console] Skip Interrupt test on Solaris too
48db3616da
2021-10-11 11:33:15 +09:00
David Rodríguez
bbcf8f87ac [ruby/rubygems] Check safety of packaged symlinks
If we explicitly disallow the creation of symlinks that point to files
outside of the destination directory, we can avoid any other safety
checks while creating directories, because we can be sure they will
always fall under the destination directory as well.

555692b8de
2021-10-10 23:12:47 +09:00
David Rodríguez
05e3d7b967 [ruby/rubygems] Explicit check file not created outside of destination
1e363dbbcb
2021-10-10 23:12:21 +09:00
David Rodríguez
48e4dea4cd [ruby/rubygems] Refactor symlink attack specs
9180b390aa
2021-10-10 23:12:15 +09:00
aycabta
d0f2c4d053 [ruby/reline] Fix tests to show dialog to the right edge
6a0d0ada94
2021-10-09 23:23:14 +09:00
aycabta
bf1f6a696f [ruby/reline] Add a test for full-width scrollbar
cff83e68f8
2021-10-09 23:23:07 +09:00
Masataka Pocke Kuwabara
d03d122ba1 [rubygems/rubygems] Improve performance of Specification#missing_extensions?
90c1919f94
2021-10-09 08:04:08 +09:00
Jeremy Evans
08759edea8
Remove autoload for constant if the autoload fails
Previously, if an autoload failed (the file was loaded, but the
constant was not defined by the autoloaded file). Ruby will try
to autoload again if you delete the autoloaded file from
$LOADED_FEATURES.  With this change, the autoload and the
constant itself are removed as soon as it fails.

To handle cases where multiple threads are autoloading, when
deleting an autoload, handle the case where another thread
already deleted it.

Fixes [Bug #15790]
2021-10-08 14:54:26 -07:00
Nobuyoshi Nakada
78ff9b719c
Add tests for the edge caces of String#end_with?
Also, check if a suffix is empty, to guarantee the assumption of
`onigenc_get_left_adjust_char_head` that `*s` is always accessible,
even in the case of `SHARABLE_MIDDLE_SUBSTRING`.
2021-10-08 14:08:03 +09:00
aycabta
1251edd1db [ruby/irb] Add tests for truncated show doc dialog
But pending them now because they need dummy document data to show doc.

ac471ee14e
2021-10-08 10:34:20 +09:00
aycabta
36bf378363 [ruby/reline] Add a test for narrow screen without scrollbar
44cd35e65d
2021-10-08 10:33:27 +09:00
aycabta
374b15a84a [ruby/reline] Cut off the excess on narrow screen
972cc993ca
2021-10-08 10:33:22 +09:00
Aaron Patterson
217df51f0e Dump outer variables tables when dumping an iseq to binary
This commit dumps the outer variables table when dumping an iseq to
binary.  This fixes a case where Ractors aren't able to tell what outer
variables belong to a lambda after the lambda is loaded via ISeq.load_from_binary

[Bug #18232] [ruby-core:105504]
2021-10-07 15:39:47 -07:00
Nobuyoshi Nakada
8057129da6
Remove duplicate value checks on mrhs which always has the value 2021-10-08 00:11:22 +09:00
Jeremy Evans
bd6e1a0f08
[ruby/ipaddr] Support zone identifiers in IPv6 addresses
These are supported by Ruby's socket library if the operating system
supports zone indentifiers, so they should be supported by ipaddr.
See RFCs 4007 and 6874 for additional information.

Implements Ruby Feature #10911

09a6408fb2
2021-10-07 18:22:43 +09:00