aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [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.
* * 2019-09-26 [ci skip]git2019-09-261-1/+1
|
* Get rid of `IO.select` to fix multiline pasteNobuyoshi Nakada2019-09-261-8/+1
|
* [DOC] fixed the return value of IO#ready? [ci skip]Nobuyoshi Nakada2019-09-251-2/+1
| | | | IO#ready? returns true or false only, since r50262(1baa57b0033).
* check `ARY_SHARED_ROOT_P()`.Koichi Sasada2019-09-251-1/+5
| | | | | ARY_SHARED_ROOT_P(ary) is true, ARY_HEAP_CAPA(ary) should not be called.
* introduce `obj_ary_extracapa`.Koichi Sasada2019-09-252-0/+3
| | | | | Introduce a new debug counter `obj_ary_extracapa` which counts arrays which are `len < capa`.
* lldb_inspect: removed unnecessary newline and `end` optionNobuyoshi Nakada2019-09-251-3/+2
|
* Removed idNUMPARAM_0Nobuyoshi Nakada2019-09-253-5/+10
|
* Changed numbered parameters semanticsNobuyoshi Nakada2019-09-252-49/+13
| | | | | | | * `_1` (and no other numbered parameters) to work as `|x|`. * giving up `_0`. [ruby-core:95074] [Bug #16178]
* Simplified duplicate codeNobuyoshi Nakada2019-09-251-11/+11
|
* Revert "[ruby/io-console] Skip cursor position test on Solaris"Kazuhiro NISHIYAMA2019-09-251-1/+0
| | | | This reverts commit 5294ded681992ced2ecbd31c814b63265d2f591e.
* Do not use of non-standard escape character '\e'Kazuhiro NISHIYAMA2019-09-251-1/+1
|
* [ruby/io-console] Unique paths to be addedNobuyoshi Nakada2019-09-251-0/+1
| | | | https://github.com/ruby/io-console/commit/a3ad851b6c
* [ruby/io-console] Load the current librariesNobuyoshi Nakada2019-09-251-1/+3
| | | | https://github.com/ruby/io-console/commit/ab7653c543
* * 2019-09-25 [ci skip]git2019-09-251-1/+1
|
* [ruby/io-console] Skip cursor position test on SolarisNobuyoshi Nakada2019-09-251-0/+1
| | | | | | It results in a mysterious failure. https://github.com/ruby/io-console/commit/e3543c3da4
* Make numbered parameters exclusive in a scopeNobuyoshi Nakada2019-09-242-12/+112
|
* Changed numbered parameter prefixNobuyoshi Nakada2019-09-248-94/+62
|
* Added implicit block parameterNobuyoshi Nakada2019-09-241-8/+30
|
* Rename from ruby-x.y.z.ext.draft to ruby-x.y.z-draft.ext [ci skip]Kazuhiro NISHIYAMA2019-09-241-4/+4
|
* misc/lldb_cruby.py: update for python3 [ci skip]Nobuyoshi Nakada2019-09-241-35/+36
| | | | lldb module bundled with Xcode is for Python 3 now.
* misc/lldb_cruby.py: removed unused module `commands` [ci skip]Nobuyoshi Nakada2019-09-241-1/+0
|
* [ruby/io-console] Made cursor position 0-originNobuyoshi Nakada2019-09-242-2/+27
| | | | https://github.com/ruby/io-console/commit/9377e37295
* [ruby/io-console] Made cursor position consistent with `winsize`Nobuyoshi Nakada2019-09-241-11/+9
| | | | | | | To be consistent with `winsize`, changed the cursor position format from `[x, y]` to `[row, column]`. https://github.com/ruby/io-console/commit/d1f5ae9286
* suppress meddlesome clang10 warrning卜部昌平2019-09-241-1/+1
| | | | | | | | | It says: vm.c:2519:34: warning: expression does not compute the number of elements in this array; element type is 'const struct __jmp_buf_tag', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div] sizeof(ec->machine.regs) / sizeof(VALUE)); ~~~~~~~~~~~~~~~~ ^ vm.c:2519:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
* refactor delete unused variable卜部昌平2019-09-241-2/+1
| | | | cadfaacb2533d47d52dbb5dbefe724d7bf11112e missed it.
* * 2019-09-24 [ci skip]git2019-09-241-1/+1
|
* Make public_send and rb_f_send handle keyword argument separationJeremy Evans2019-09-232-2/+127
| | | | | Kernel#send takes a different optimized code path that was already handled.
* [ruby/io-console] Try fallback to stdout when stdinNobuyoshi Nakada2019-09-231-0/+4
| | | | https://github.com/ruby/io-console/commit/b8017509ef
* [ruby/io-console] Try to write DSR query to writable IONobuyoshi Nakada2019-09-231-2/+21
| | | | https://github.com/ruby/io-console/commit/a54b6e4dd1
* Use short wait for select(2)aycabta2019-09-231-2/+2
| | | | It is one of the reasons why paste to IRB is slow.
* Retrieve key-buffer that was supposed to loseaycabta2019-09-231-0/+10
|