summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-10-03Try disabling build on trunkTakashi Kokubun
2019-10-03Document *_kw functions added to include/ruby/ruby.h [ci skip]Jeremy Evans
Also documents the non-*_kw functions if they were not already documented.
2019-10-03Add documentation regarding keyword argument separation [ci skip]Jeremy Evans
2019-10-03Minor updates to methods and calling_methods documentation [ci skip]Jeremy Evans
2019-10-04Enable Drone CI for ARM 64/32-bit cases. (#2520)Jun Aruga
https://bugs.ruby-lang.org/issues/16234
2019-10-04iseq.c (rb_iseq_compile_with_option): dummy parent_iseq for the parserYusuke Endoh
The parsing of `RubyVM::InstructionSequence.compile` does not support an outer scope currently. So it specified NULL as parent_iseq for the parser. However, it resulted in the following false-positive warning. ``` RubyVM::InstructionSequence.compile(<<END) o = Object.new o #=> <compiled>:2: warning: possibly useless use of a variable in void context END ``` This change specifies a dummy empty parent_iseq instead of NULL, which suppresses the false positive.
2019-10-04parse.y: use "struct rb_iseq_struct" instead of rb_iseq_tYusuke Endoh
typedef was not declared in parse.y. Sorry.
2019-10-04* 2019-10-04 [ci skip]git
2019-10-04Make parser_params have parent_iseq instead of base_blockYusuke Endoh
The parser needs to determine whether a local varaiable is defined or not in outer scope. For the sake, "base_block" field has kept the outer block. However, the whole block was actually unneeded; the parser used only base_block->iseq. So, this change lets parser_params have the iseq directly, instead of the whole block. Notes: Merged: https://github.com/ruby/ruby/pull/2519
2019-10-04Refactor parser_params by removing "in_main" flagYusuke Endoh
The relation between parser_param#base_block and #in_main were very subtle. A main script (that is passed via a command line) was parsed under base_block = TOPLEVEL_BINDING and in_main = 1. A script loaded by Kernel#require was parsed under base_block = NULL and in_main = 0. If base_block is non-NULL and in_main == 0, it is parsed by Kernel#eval or family. However, we know that TOPLEVEL_BINDING has no local variables when a main script is parsed. So, we don't have to parse a main script under base_block = TOPLEVEL_BINDING. Instead, this change parses a main script under base_block = 0. If base_block is non-NULL, it is parsed by Kernel#eval or family. By this simplication, "in_main" is no longer needed. Notes: Merged: https://github.com/ruby/ruby/pull/2519
2019-10-03make-snapshot: touch updated files after preparedNobuyoshi Nakada
Align mtime of files updated by `make prepare-package` to make packages reproducible.
2019-10-03make-snapshot: suppress make error messages unless failedNobuyoshi Nakada
2019-10-03make-snapshot: copy cache files instead of linkingNobuyoshi Nakada
To get rid of setting mode and mtime of the original cache files.
2019-10-03vcs.rb: fix to export git-svn versionNobuyoshi Nakada
* Use the given branch name instead of implicit 'HEAD". * Format like as git-svn when `from` or `to` is SVN revision number.
2019-10-03[ruby/fileutils] Use pend instead of skipHiroshi SHIBATA
https://github.com/ruby/fileutils/commit/ba2c24e2d7
2019-10-03[ruby/fileutils] improve the compatibility of minitestHiroshi SHIBATA
https://github.com/ruby/fileutils/commit/f16f5a0dd6
2019-10-03add debug counters for vm_search_method_slowpath()卜部昌平
Implemented fine-grained inspection of cache misshits. Handy for counting the reasons why an inline method cache was evicted.
2019-10-03use bind_call for test-all --gc-stress卜部昌平
This one allocation of Method object is worth avoiding. We don't want to test UnboundMethod#bind right here. GC need not run.
2019-10-03Resolve unused local variable reported by LGTMRomain Tartière
LGTM reports that the value assigned to local variable 'shared' is never used: https://lgtm.com/projects/g/ruby/ruby/snapshot/f319a5d064627c6641817ec2ed16b97b4d215148/files/misc/lldb_cruby.py#x6512c0281581a470:1 This problem was introduced in by the refactoring that took place in 7c496b6624f720d539e3c0b40f122a9422a13b99. Notes: Merged: https://github.com/ruby/ruby/pull/2517
2019-10-03* 2019-10-03 [ci skip]git
2019-10-03* expand tabs. [ci skip]git
Tabs were expanded because previously the file did not have any tab indentation. Please update your editor config, and use misc/expand_tabs.rb in the pre-commit hook.
2019-10-03Revert https://github.com/ruby/ruby/pull/2486卜部昌平
This reverts commits: 10d6a3aca7 8ba48c1b85 fba8627dc1 dd883de5ba 6c6a25feca 167e6b48f1 7cb96d41a5 3207979278 595b3c4fdd 1521f7cf89 c11c5e69ac cf33608203 3632a812c0 f56506be0d 86427a3219 . The reason for the revert is that we observe ABA problem around inline method cache. When a cache misshits, we search for a method entry. And if the entry is identical to what was cached before, we reuse the cache. But the commits we are reverting here introduced situations where a method entry is freed, then the identical memory region is used for another method entry. An inline method cache cannot detect that ABA. Here is a code that reproduce such situation: ```ruby require 'prime' class << Integer alias org_sqrt sqrt def sqrt(n) raise end GC.stress = true Prime.each(7*37){} rescue nil # <- Here we populate CC class << Object.new; end # These adjacent remove-then-alias maneuver # frees a method entry, then immediately # reuses it for another. remove_method :sqrt alias sqrt org_sqrt end Prime.each(7*37).to_a # <- SEGV ```
2019-10-02Treat return in block in class/module as LocalJumpError (#2511)Jeremy Evans
return directly in class/module is an error, so return in proc in class/module should also be an error. I believe the previous behavior was an unintentional oversight during the addition of top-level return in 2.4. Notes: Merged-By: jeremyevans <code@jeremyevans.net>
2019-10-02fix assertion number.Koichi Sasada
On parallel test, there are additional tests because of implicit checkers which are enabled on 84cbce3d88.
2019-10-02Fixed failure message for `clean-cache`Nobuyoshi Nakada
2019-10-02Enable checkers on parallel test.Koichi Sasada
parallel test (`make test-all TESTS=-j8`) runs tests on specified number of processes. However, some test checkers written in `runner.rb` are not loaded. This fix enable these checkers on parallel tests. See also: https://github.com/ruby/ruby/pull/2508
2019-10-02Iseq#to_binary: dump flag for **nil (#2508)Alan Wu
RUBY_ISEQ_DUMP_DEBUG=to_binary and the attached test case was failing. Dump the flag to make sure `**nil` can round-trip properly.
2019-10-02* 2019-10-02 [ci skip]git
2019-10-02Fix the order of executing `after-update` taskNAKAMURA Usaku
2019-10-02Should fail if `system` failedNAKAMURA Usaku
2019-10-01expose assert_raise and assert_join_threadsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/2516
2019-10-01Remove draft-release.yml [ci skip]Kazuhiro NISHIYAMA
I thought default branch's workflow runs on any tags, but it does not run for stable branches without draft-release.yml. So I abandoned, and use workflow in ruby/actions instead.
2019-10-01WEBrick: prevent response splitting and header injectionYusuke Endoh
This is a follow up to d9d4a28f1cdd05a0e8dabb36d747d40bbcc30f16. The commit prevented CRLR, but did not address an isolated CR or an isolated LF. Co-Authored-By: NARUSE, Yui <naruse@airemix.jp>
2019-10-01Loop with String#scan without creating substringsNobuyoshi Nakada
Create the substrings necessary parts only, instead of cutting the rest of the buffer. Also removed a useless, probable typo, regexp.
2019-10-01Fix for wrong fnmatch pattternNobuyoshi Nakada
* dir.c (file_s_fnmatch): ensure that pattern does not contain a NUL character. https://hackerone.com/reports/449617
2019-10-01ext/-test-/enumerator_kw/enumerator_kw.c: remove unused variableYusuke Endoh
2019-10-01* 2019-10-01 [ci skip]git
2019-10-01remove `unused var` warningKoichi Sasada
2019-09-30Issue keyword flag warning even with no argumentsJeremy Evans
If the keyword flag is set, there should be at least one argument, if there isn't, that is a sign the keyword flag was passed when it should not have been. Notes: Merged: https://github.com/ruby/ruby/pull/2509
2019-09-30Add rb_enumeratorize_with_size_kw and related macrosJeremy Evans
Currently, there is not a way to create a sized enumerator in C with a different set of arguments than provided by Ruby, and correctly handle keyword arguments. This function allows that. The need for this is fairly uncommon, but it occurs at least in Enumerator.produce, which takes arugments from Ruby but calls rb_enumeratorize_with_size with a different set of arguments. Notes: Merged: https://github.com/ruby/ruby/pull/2509
2019-09-30test/ruby/test_io.rb: supress a "method redefined" warningYusuke Endoh
by explicitly removing the old definition.
2019-09-30test/-ext-/string/test_fstring.rb: suppress "possibly useless use of -@"Yusuke Endoh
"in void context" by assigning the result to a dummy variable.
2019-09-30Revert "introduce debug check."Koichi Sasada
This reverts commit c3b84f2de83a27acc638f99743bfa2c44bac621c. Backtrace shows it is before running tests and debug check was nonsense.
2019-09-30Fix assertionNobuyoshi Nakada
callable_method_entry_p is for rb_callable_method_entry_t.
2019-09-30Use assert_operator instead of mere assertNobuyoshi Nakada
2019-09-30Now `use_symbol` is always trueNobuyoshi Nakada
2019-09-30introduce debug check.Koichi Sasada
There are random failures: > lib/rubygems/core_ext/kernel_require.rb:61:in `require': > wrong number of arguments (given 1, expected 0) (ArgumentError) http://ci.rvm.jp/results/trunk-jemalloc@silicon-docker/2275159 To check this failure, I added a small check code.
2019-09-30Emulate method_list (chkbuild) on test-all.Koichi Sasada
chkbuild (CI process) shows methods list before running tests and sometimes it can fails. This commit a code part to emulate this method listing feature.
2019-09-30show RUBY_ISEQ_DUMP_DEBUG envval if given.Koichi Sasada
2019-09-30rb_method_attr_t::location should be 0 or others.Koichi Sasada
method_def_location() expects that rb_method_attr_t::location is 0 (Qfalse) or not.