aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Check the argument sizeNobuyoshi Nakada2019-09-271-0/+1
| | | | | Ensure that argument array size does not overflow as `int`, before cast in thread_do_start after new thread created.
* * 2019-09-27 [ci skip]git2019-09-271-1/+1
|
* Fix shorten-64-to-32 compile warnings/errorsJeremy Evans2019-09-261-1/+1
|
* Fix keyword argument separation issues in Fiber#resumeJeremy Evans2019-09-263-11/+109
|
* Fix keyword argument separation issues in Thread.newJeremy Evans2019-09-263-3/+91
|
* Fix more keyword argument separation issues in PathnameJeremy Evans2019-09-262-5/+37
|
* Fix keyword argument separation issues in ↵Jeremy Evans2019-09-262-4/+28
| | | | | | | | | OpenSSL::SSL::SSLSocket#sys{read,write}_nonblock It's unlikely anyone would actually hit these. The methods are private, you only hit this code path if calling these methods before performing the SSL connection, and there is already a verbose warning issued.
* Fix keyword argument separation issues in Proc#{<<,>>}Jeremy Evans2019-09-263-2/+155
| | | | This requires adding rb_proc_call_with_block_kw.
* Fix keyword argument sepration issues when IO#open calls #to_openJeremy Evans2019-09-261-0/+13
|
* Fix Module#name news and add a testJean Boussier2019-09-262-2/+6
|
* Restore ENV, rubygems always sets SOURCE_DATE_EPOCH nowNobuyoshi Nakada2019-09-261-0/+2
|
* Gem::Specification#to_ruby needs OpenSSLNobuyoshi Nakada2019-09-261-0/+1
|
* Reduce ISeq size of mjit_exec benchmarkTakashi Kokubun2019-09-264-22/+15
| | | | to avoid unwanted memory pressure
* * remove trailing spaces. [ci skip]git2019-09-261-1/+1
|
* [EXPERIMENTAL] Make Module#name return a frozen StringJean Boussier2019-09-263-9/+24
| | | | | | * Always the same frozen String for a given Module or Class. * Avoids extra allocations whenever calling Module#name. * See [Feature #16150]
* Revert the accidentally commits related GitHub ActionsHiroshi SHIBATA2019-09-262-55/+0
|
* Suppress assert_match warnings.Hiroshi SHIBATA2019-09-261-2/+2
|
* Assert warnings message for the last argument is keyword parameter.Hiroshi SHIBATA2019-09-261-2/+2
|
* [rubygems/rubygems] Make sure our modifications to kernel.warn workDavid Rodríguez2019-09-262-0/+16
| | | | | | And test the fix we're adding. https://github.com/rubygems/rubygems/commit/6f86637b98
* [rubygems/rubygems] Fix jruby buildDavid Rodríguez2019-09-261-1/+5
| | | | https://github.com/rubygems/rubygems/commit/cc255b774a
* [rubygems/rubygems] indentHiroshi SHIBATA2019-09-261-4/+4
| | | | https://github.com/rubygems/rubygems/commit/8cdb2fd66f
* [rubygems/rubygems] filter dependency type and name strictly.Hiroshi SHIBATA2019-09-261-1/+5
| | | | | | Co-authored-by: Yusuke Endoh <mame@ruby-lang.org> https://github.com/rubygems/rubygems/commit/92892bbc3a
* [rubygems/rubygems] Fix test_gem_attrbronzdoc2019-09-261-4/+4
| | | | https://github.com/rubygems/rubygems/commit/7c5b66f9ef
* [rubygems/rubygems] Introduce default prerelease requirementDavid Rodríguez2019-09-263-3/+14
| | | | https://github.com/rubygems/rubygems/commit/506c5bce49
* [rubygems/rubygems] Remove comment not adding muchDavid Rodríguez2019-09-261-3/+0
| | | | https://github.com/rubygems/rubygems/commit/b3b5c2d379
* [rubygems/rubygems] add testsf2019-09-262-1/+2
| | | | https://github.com/rubygems/rubygems/commit/8a7e27381c
* [rubygems/rubygems] Detect libc version, closes #2918f2019-09-261-1/+1
| | | | https://github.com/rubygems/rubygems/commit/1d18b12a26
* [rubygems/rubygems] Fix underscore version for bundler itselfDavid Rodríguez2019-09-262-1/+35
| | | | | | Previously it wouldn't play nice with the bundler version finder. https://github.com/rubygems/rubygems/commit/d8bb81556d
* [rubygems/rubygems] Added jruby to matrixHiroshi SHIBATA2019-09-261-1/+1
| | | | https://github.com/rubygems/rubygems/commit/0832c079c8
* [rubygems/rubygems] Removed 2.2Hiroshi SHIBATA2019-09-261-1/+1
| | | | https://github.com/rubygems/rubygems/commit/7fd2460f76
* [rubygems/rubygems] Added rvm workflow for Ruby 2.2 and 2.7Hiroshi SHIBATA2019-09-261-0/+34
| | | | https://github.com/rubygems/rubygems/commit/d4ba75dfd2
* [rubygems/rubygems] Removed the needless configurationsHiroshi SHIBATA2019-09-261-9/+1
| | | | https://github.com/rubygems/rubygems/commit/7134c49179
* [rubygems/rubygems] Added the initial workflow file.Hiroshi SHIBATA2019-09-261-0/+29
| | | | https://github.com/rubygems/rubygems/commit/6405a1e51a
* [rubygems/rubygems] Avoid adding OpenSSL::PKey::RSA instancesbronzdoc2019-09-261-4/+2
| | | | https://github.com/rubygems/rubygems/commit/ba021fb4be
* [rubygems/rubygems] Update expectation in test_to_ruby_with_rsa_keybronzdoc2019-09-261-2/+1
| | | | https://github.com/rubygems/rubygems/commit/2e65f7d4ae
* [rubygems/rubygems] Fix indentation in case statementbronzdoc2019-09-261-10/+10
| | | | https://github.com/rubygems/rubygems/commit/8ac0647659
* [rubygems/rubygems] Make ruby_code method handle OpenSSL::PKey::RSA objectsbronzdoc2019-09-262-0/+31
| | | | https://github.com/rubygems/rubygems/commit/b1d825ab3a
* [rubygems/rubygems] Set SOURCE_DATE_EPOCH env var if not provided.Ellen Marie Dash2019-09-266-6/+82
| | | | | | | | | | | | | Fixes #2290. 1. `Gem::Specification.date` returns SOURCE_DATE_EPOCH when defined, 2. this commit makes RubyGems set it _persistently_ when not provided. This combination means that you can build a gem, check the build time, and use that value to generate a new build -- and then verify they're the same. https://github.com/rubygems/rubygems/commit/d830d53f59
* [rubygems/rubygems] Add a gem attr to the Gem::Package class.Daniel Berger2019-09-262-0/+10
| | | | https://github.com/rubygems/rubygems/commit/5b81f364ae
* [EXPERIMENTAL] Make Symbol#to_s return a frozen StringBenoit Daloze2019-09-264-3/+31
| | | | | | * Always the same frozen String for a given Symbol. * Avoids extra allocations whenever calling Symbol#to_s. * See [Feature #16150]
* Add special runner to benchmark mjit_execTakashi Kokubun2019-09-265-46/+268
| | | | | I wanted to dynamically generate benchmark cases to test various number of methods. Thus I added a dedicated runner of benchmark-driver.
* RubyVM::MJIT.pause(wait: true) should waitTakashi Kokubun2019-09-264-3/+25
| | | | | | | | | | | for all compilations and compaction. Prior to this commit, the last-compiled code has not been used because MJIT worker is stopped before setting the code, and compaction has also been skipped. But it was not intentional and `wait: true` pause should wait until those two things by its feature.
* Rename STR_IS_SHARED_M to STR_BORROWEDAlan Wu2019-09-261-6/+7
| | | | | | | Since the introduction of STR_SHARED_ROOT, the word "shared" has become very overloaded with respect to String's internal states. Use a different name for STR_IS_SHARED_M and explain its purpose.
* Tag string shared roots to fix use-after-freeAlan Wu2019-09-262-4/+25
| | | | | | | | | | | | | | The buffer deduplication codepath in rb_fstring can be used to free the buffer of shared string roots, which leads to use-after-free. Introudce a new flag to tag strings that at one point have been a shared root. Check for it in rb_fstring to avoid freeing buffers that are shared by multiple strings. This change is based on nobu's idea in [ruby-core:94838]. The included test case test for the sequence of calls to internal functions that lead to this bug. See attached ticket for Ruby level repros. [Bug #16151]
* [EXPERIMENTAL] Expression with modifier `in`Nobuyoshi Nakada2019-09-263-3/+26
| | | | [Feature #15865]
* include/ruby/ruby.h: suppress a false-positive warning of GCCYusuke Endoh2019-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC emits a lot of false positives for rb_scan_args because: * `rb_scan_args(argc, argv, "*:", NULL, &opts);` makes `n_mand == 0`, * `n_mand == argc + 1` implies `argc == -1`, and * `memcpy(ptr, argv, sizeof(VALUE)*argc);` explodes However, we know that argc is never so big, thus this is a false positive. This change suppresses it by adding a condition `n_mand > 0`. ``` In file included from /usr/include/string.h:494, from ./include/ruby/defines.h:145, from ./include/ruby/ruby.h:29, from ./include/ruby/encoding.h:27, from dir.c:14: In function 'memcpy', inlined from 'ruby_nonempty_memcpy.part.0' at ./include/ruby/ruby.h:1763:17, inlined from 'ruby_nonempty_memcpy' at ./include/ruby/ruby.h:1760:1, inlined from 'rb_scan_args_set' at ./include/ruby/ruby.h:2594:9, inlined from 'dir_s_aref' at dir.c:2774:12: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: '__builtin___memcpy_chk' pointer overflow between offset 0 and size [-8, 9223372036854775807] [-Warray-bounds] return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: '__builtin___memcpy_chk' specified size 18446744073709551608 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=] ```
* [ruby/io-console] Defer creating VT query stringNobuyoshi Nakada2019-09-261-9/+23
| | | | https://github.com/ruby/io-console/commit/3d69c577a4
* [ruby/io-console] Added IO#console_modeNobuyoshi Nakada2019-09-261-0/+122
| | | | https://github.com/ruby/io-console/commit/77ed8d5a06
* Add Module#ruby2_keywords for passing keywords through regular argument splatsJeremy Evans2019-09-258-28/+450
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This approach uses a flag bit on the final hash object in the regular splat, as opposed to a previous approach that used a VM frame flag. The hash flag approach is less invasive, and handles some cases that the VM frame flag approach does not, such as saving the argument splat array and splatting it later: ruby2_keywords def foo(*args) @args = args bar end def bar baz(*@args) end def baz(*args, **kw) [args, kw] end foo(a:1) #=> [[], {a: 1}] foo({a: 1}, **{}) #=> [[{a: 1}], {}] foo({a: 1}) #=> 2.7: [[], {a: 1}] # and warning foo({a: 1}) #=> 3.0: [[{a: 1}], {}] It doesn't handle some cases that the VM frame flag handles, such as when the final hash object is replaced using Hash#merge, but those cases are probably less common and are unlikely to properly support keyword argument separation. Use ruby2_keywords to handle argument delegation in the delegate library.
* Make rb_scan_args handle keywords more similar to Ruby methods (#2460)Jeremy Evans2019-09-2531-179/+508
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cfuncs that use rb_scan_args with the : entry suffer similar keyword argument separation issues that Ruby methods suffer if the cfuncs accept optional or variable arguments. This makes the following changes to : handling. * Treats as **kw, prompting keyword argument separation warnings if called with a positional hash. * Do not look for an option hash if empty keywords are provided. For backwards compatibility, treat an empty keyword splat as a empty mandatory positional hash argument, but emit a a warning, as this behavior will be removed in Ruby 3. The argument number check needs to be moved lower so it can correctly handle an empty positional argument being added. * If the last argument is nil and it is necessary to treat it as an option hash in order to make sure all arguments are processed, continue to treat the last argument as the option hash. Emit a warning in this case, as this behavior will be removed in Ruby 3. * If splitting the keyword hash into two hashes, issue a warning, as we will not be splitting hashes in Ruby 3. * If the keyword argument is required to fill a mandatory positional argument, continue to do so, but emit a warning as this behavior will be going away in Ruby 3. * If keyword arguments are provided and the last argument is not a hash, that indicates something wrong. This can happen if a cfunc is calling rb_scan_args multiple times, and providing arguments that were not passed to it from Ruby. Callers need to switch to the new rb_scan_args_kw function, which allows passing of whether keywords were provided. This commit fixes all warnings caused by the changes above. It switches some function calls to *_kw versions with appropriate kw_splat flags. If delegating arguments, RB_PASS_CALLED_KEYWORDS is used. If creating new arguments, RB_PASS_KEYWORDS is used if the last argument is a hash to be treated as keywords. In open_key_args in io.c, use rb_scan_args_kw. In this case, the arguments provided come from another C function, not Ruby. The last argument may or may not be a hash, so we can't set keyword argument mode. However, if it is a hash, we don't want to warn when treating it as keywords. In Ruby files, make sure to appropriately use keyword splats or literal keywords when calling Cfuncs that now issue keyword argument separation warnings through rb_scan_args. Also, make sure not to pass nil in place of an option hash. Work around Kernel#warn warnings due to problems in the Rubygems override of the method. There is an open pull request to fix these issues in Rubygems, but part of the Rubygems tests for their override fail on ruby-head due to rb_scan_args not recognizing empty keyword splats, which this commit fixes. Implementation wise, adding rb_scan_args_kw is kind of a pain, because rb_scan_args takes a variable number of arguments. In order to not duplicate all the code, the function internals need to be split into two functions taking a va_list, and to avoid passing in a ton of arguments, a single struct argument is used to handle the variables previously local to the function.