aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* appveyor.yml - msys2 update codeMSP-Greg2019-09-071-2/+2
| | | | | | As AppVeyor's MSYS2 install gets out of date, this may require 'special' code... This code also adds updating the database, which currently updates gcc from 9.1.0 to 9.2.0.
* eval.c (rb_rescue2): fix a probably wrong returnYusuke Endoh2019-09-071-1/+2
| | | | | This return skips `va_end(ap)`, which is not intended, I guess. Coverity Scan found this.
* Upgrade benchmark-driver to v0.15.4Takashi Kokubun2019-09-071-1/+1
| | | | Fixing a bug on Windows introduced in v0.15.0
* Fix SortedSet subclasses that override initializeJeremy Evans2019-09-061-1/+2
| | | | | | | | | | | | | The first time SortedSet#initialize is called, it overwrites itself, then recalls #initialize, which results in calling the subclass's initialize, not the current initialize. Just inline the default initialize behavior to avoid this issue. No test for this as it can only be triggered the very first time that SortedSet#initialize is called. Fixes [Bug #15830]
* * 2019-09-07 [ci skip]git2019-09-071-1/+1
|
* Upgrade benchmark-driver to v0.15.3Takashi Kokubun2019-09-071-1/+1
| | | | | It got some nice features for better support of benchmark_driver-output-charty, Windows, ridk, and rbenv.
* Fix a use-after-free bug by avoiding rb_str_new_frozenYusuke Endoh2019-09-061-1/+2
| | | | | | | | | | | | | | `str2 = rb_str_new_frozen(str1)` seems to make str1 a shared string that refers to str2, but str2 is not marked as STR_IS_SHARED_M nor STR_NOFREE. `rb_fstring(str2)` frees str2's ptr because it is not marked, and the free'ed pointer is the same as str1's ptr. After that, accessing str1 may cause use-after-free memory corruption. I guess this is a bug of rb_str_new_frozen, but I'm completely unsure what it should be; the string states and flags are not documented. So, this is a workaround for [Bug #16136]. I confirmed that rspec of activeadmin runs gracefully.
* VCS::GIT no longer accepts remote repositoryNobuyoshi Nakada2019-09-061-4/+2
|
* Stop setting same flags as cflags to cxxflagsNobuyoshi Nakada2019-09-061-6/+6
|
* Check clang++ as CXX when CXX is bare clang without suffixNobuyoshi Nakada2019-09-061-1/+1
|
* save committers' weekend from CI failures卜部昌平2019-09-063-378/+0
| | | | Kill the failing tests.
* Try to fix compile error on win32Kazuhiro NISHIYAMA2019-09-061-0/+2
| | | | | | | | https://github.com/ruby/ruby/runs/213995386#step:7:810 ``` cxxanyargs.cpp C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_malloc.h(54): error C2485: '__restrict': unrecognized extended attribute ```
* avoid name mangling卜部昌平2019-09-061-1/+1
| | | | | Otherwise the dynamic linker cannot find this function. See also https://ci.appveyor.com/project/ruby/ruby/builds/27224231/job/4pg6lxlsnsjotu2l
* nullptr is a C++11ism.卜部昌平2019-09-061-2/+3
| | | | | Should use numeric 0 for maximum portability. See also https://travis-ci.org/ruby/ruby/jobs/581543798
* fix Visual Studio compilation error卜部昌平2019-09-062-2/+2
| | | | See also https://github.com/ruby/ruby/runs/213964487
* add test for cxxanyargs.hpp卜部昌平2019-09-063-0/+377
|
* add include/ruby/backward/cxxanyargs.hpp卜部昌平2019-09-065-6/+399
| | | | | | | | | | | | | | Compilation of extension libraries written in C++ are reportedly broken due to https://github.com/ruby/ruby/pull/2404 The root cause of this issue was that the definition of ANYARGS differ between C and C++, and that of C++ is incompatible with the updated ones. We are using the incompatibility against itself. In C++ two distinct function prototypes can be overloaded. We provide the old, ANYARGSed prototypes in addition to the current granular ones; and let the older ones warn about types.
* doxygen update [ci skip]卜部昌平2019-09-061-1/+2
|
* Revert "Add a temporal stack dumper for debugging on trunk-mjit"Yusuke Endoh2019-09-061-3/+0
| | | | | | | This reverts commit 433c9c00d96124e3b416d0a20ff795b0ad4273fa. Successfully captured some traces, and 3b60e5e6bc2c84b971bea9c8312eb5d33ada2ff5 seems to fix the issue.
* Try shrinking tested VM stack maxTakashi Kokubun2019-09-061-2/+2
|
* * remove trailing spaces. [ci skip]git2019-09-061-1/+1
|
* Mark rb_warn_keyword_to_last_hash as static inlineJeremy Evans2019-09-052-2/+1
| | | | mame pointed out that vm_args.c is included in vm_insnhelper.c.
* Mark rb_warn_keyword_to_last_hash at MJIT_FUNC_EXPORTEDJeremy Evans2019-09-051-1/+1
| | | | Hopefully this fixes MJIT errors on AppVeyor.
* Convert empty keyword hash to required positional argument and warn for ↵Jeremy Evans2019-09-052-5/+13
| | | | | | | | method_missing This is the same as the bmethod, sym proc, and send cases, where we don't remove the keyword splat, so later code can move it to a required positional parameter and warn.
* Convert empty keyword hash to required positional argument and warn for sym ↵Jeremy Evans2019-09-052-5/+13
| | | | | | | | procs This is the same as the bmethod and send cases, where we don't remove the keyword splat, so later code can move it to to a a required positional parameter and warn.
* Convert empty keyword hash to required positional argument and warn for ↵Jeremy Evans2019-09-052-65/+37
| | | | | | | | | | | | | | | | | | | | | | | lambda and bmethod The lambda case is similar to the attr_writer case, except we have to determine the number of required parameters from the iseq instead of being able to assume a single required parameter. This fixes a lot of lambda tests which were switched to require warnings for all usage of keyword arguments. Similar to method handling, we do not warn when passing keyword arguments to lambdas that do not accept keyword arguments, the argument is just passed as a positional hash in that case, unless it is empty. If it is empty and not the final required parameter, then we ignore it. If it is empty and the final required parameter, then we pass it for backwards compatibility and emit a warning, as in Ruby 3 we will not pass it. The bmethod case is similar to the send case, in that we do not want to remove empty keyword splats in vm_call_bmethod, as that prevents later call handling from moving them to required positional arguments and warning.
* Convert empty keyword hash to required positional argument and warnJeremy Evans2019-09-053-25/+166
| | | | | | | | | | | | | | | | | | | | | | | | | In general, we want to ignore empty keyword hashes. The only case where we want to allow them for backwards compatibility is when they are necessary to satify the final required positional argument. In that case, we want to not ignore them, but we do want to warn, as that will be going away in Ruby 3. This commit implements this support for regular methods and attr_writer methods. In order to allow send to forward arguments correctly, send no longer removes empty keyword hashes. It is the responsibility of the final method to remove the empty keyword hashes now. This change was necessary as otherwise send could remove the empty keyword hashes before the regular or attr_writer methods could move them to required positional arguments. For completeness, add tests for keyword handling regular methods calls. This makes rb_warn_keyword_to_last_hash non-static in vm_args.c so it can be reused in vm_insnhelper.c, and also moves declarations before statements in the rb_warn_* functions in vm_args.c.
* Always remove empty keyword hashes when calling methodsJeremy Evans2019-09-052-45/+34
| | | | | | | | | | | | | | | While doing so is not backwards compatible with Ruby 2.6, it is necessary for generic argument forwarding to work for all methods: ```ruby def foo(*args, **kw, &block) bar(*args, **kw, &block) end ``` If you do not remove empty keyword hashes, and bar does not accept keyword arguments, then a call to foo without keyword arguments calls bar with an extra positional empty hash argument.
* Add a keyword-to-last-hash warning for some case of define_method methodYusuke Endoh2019-09-052-25/+79
| | | | | | | and lambda. When define_method is a simple iseq (`define_method(:m) {|x| ... }`), passing keywords to it (`m(**kw)`) didn't print a warning.
* define_method should not drop the empty keyword hashYusuke Endoh2019-09-052-5/+5
| | | | Similar to 38e9c1bc35d5549575fbb263afff560e97db068e
* vm_call_bmethod should not drop the empty keyword hashYusuke Endoh2019-09-052-2/+4
| | | | Similar to 38e9c1bc35d5549575fbb263afff560e97db068e
* vm_call_opt_send should not drop the empty keyword hashYusuke Endoh2019-09-052-3/+4
| | | | | | Now the mechanism that conveys kw_splat flag is gradually established, so the hack to drop the empty keyword hash is not needed for vm_call_opt_send.
* test_method_missing_kwsplat should call the target directlyYusuke Endoh2019-09-051-41/+44
| | | | not via Object#send which uses a fast path vm_call_opt_send.
* vm_insnhelper.c: Do not read `ci->flag` after CALLER_SETUP_ARGYusuke Endoh2019-09-051-2/+2
| | | | | | | | | | | | | | Actually, the following call is wrongly warned without this change. ``` class C def method_missing(x, *args, **opt) end end C.new.foo(k: 1) # warning: The last argument is used as the keyword parameter # warning: for `method_missing' defined here ```
* Add a comment that some ci->flag is inconsistent after CALLER_SETUP_ARGYusuke Endoh2019-09-051-0/+10
|
* Ignore an empty keyword splat for attr_reader/writer methodsYusuke Endoh2019-09-052-2/+48
|
* C method should accept a keyword hash (for compatibility with 2.6)Yusuke Endoh2019-09-052-9/+9
|
* CALLER_SETUP_ARG removes an empty keyword hash from argvYusuke Endoh2019-09-052-36/+14
| | | | | | | | | ...only when a "remove_empty_keyword_hash" flag is specified. After CALLER_SETUP_ARG is called, `ci->flag & VM_CALL_KW_SPLAT` must not be used. Instead. use `calling->kw_splat`. This is because CALLER_SETUP_ARG may modify argv and update `calling->kw_splat`, and `ci->flag & VM_CALL_KW_SPLAT` may be inconsistent with the result.
* vm_argc.c (vm_caller_setup_arg_kw): "cfunc" argument is no longer usedYusuke Endoh2019-09-052-2/+2
|
* Set calling->kw_splat = 1 in vm_caller_setup_arg_kwYusuke Endoh2019-09-052-4/+4
| | | | | | | | | | | | | | There are two styles that argv contains keyword arguments: one is VM_CALL_KWARG which contains value elements in argv (to avoid a hash object creation if possible), and the other is VM_CALL_KW_SPLAT which contains one last hash in argv. vm_caller_setup_arg_kw translates argv from the VM_CALL_KWARG style to the VM_CALL_KW_SPLAT style. `calling->kw_splat` means that argv is the VM_CALL_KW_SPLAT style. So, instead of setting `calling->kw_splat` at many places, it would be better to do so when vm_caller_setup_arg_kw is called.
* Fix passing keywords without splats to sym procs, define_method, and ↵Jeremy Evans2019-09-052-35/+135
| | | | method_missing
* Make Symbol#to_proc calls handle keyword argumentsJeremy Evans2019-09-054-5/+77
| | | | | | Make rb_sym_proc_call take a flag for whether a keyword argument is used, and use the new rb_funcall_with_block_kw function to pass that information.
* If removing an empty keyword splat hash, unset the kw_splat flagJeremy Evans2019-09-051-0/+2
| | | | | Otherwise the last positional hash could be considered as the keyword arguments.
* Add rb_funcall_with_block_kwJeremy Evans2019-09-055-17/+36
| | | | | | | | | | | | | | | | | This is needed for C functions to call methods with keyword arguments. This is a copy of rb_funcall_with_block with an extra argument for the keyword flag. There isn't a clean way to implement this that doesn't involve changing a lot of function signatures, because rb_call doesn't support a way to mark that the call has keyword arguments. So hack this in using a CALL_PUBLIC_KW call_type, which we switch for CALL_PUBLIC later in the call stack. We do need to modify rm_vm_call0 to take an argument for whether keyword arguments are used, since the call_type is no longer available at that point. Use the passed in value to set the appropriate keyword flag in both calling and ci_entry.
* Set VM_FRAME_FLAG_CFRAME_KW if kw_splat set in vm_yield_with_cfuncJeremy Evans2019-09-051-2/+1
|
* Add VM_NO_KEYWORDSJeremy Evans2019-09-055-8/+9
| | | | | I think this is easier to read than using literal 0 with comments in every case where it is used.
* Propagate kw_splat informationYusuke Endoh2019-09-059-41/+125
| | | | | | | The kw_splat flag is whether the original call passes keyword or not. Some types of methods (e.g., bmethod and sym_proc) drops the information. This change tries to propagate the flag to the final callee, as far as I can.
* Warn local variables which conflict with new numbered parametersNobuyoshi Nakada2019-09-062-0/+17
|
* Reverting node marking until I can fix GC problem.Aaron Patterson2019-09-053-165/+36
| | | | | Looks like we're getting WB misses during stressful GC on startup. I am investigating.
* I forgot to add `break` in my case statementsAaron Patterson2019-09-051-0/+2
| | | | Give me a break.