summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-10-05ext/json/parser/prereq.mk: Add a "automatically generated" headerYusuke Endoh
to parser.c.
2019-10-05ext/json/parser/parser.rl: Update the source code of parser.cYusuke Endoh
There have been some direct changes in parser.c which is automatically generated from parser.rl. This updates parser.rl to sync the changes: * 91793b8967e0531bd1159a8ff0cc7e50739c7620 * 79ead821dd4880725c9c6bb9645b3fad71715c5b * 80b5a0ff2a7709367178f29d4ebe1c54122b1c27
2019-10-04IMEMO objects don't have a class, so return earlyAaron Patterson
IMEMO objects don't have a class field to update, so we need to return early, otherwise it can cause a segv.
2019-10-04Don't allocate objects in `gc_compact`Aaron Patterson
I'd like to call `gc_compact` after major GC, but before the GC finishes. This means we can't allocate any objects inside `gc_compact`. So in this commit I'm just pulling the compaction statistics allocation outside the `gc_compact` function so we can safely call it.
2019-10-05* 2019-10-05 [ci skip]git
2019-10-05Fix potential memory leaks by `rb_imemo_tmpbuf_auto_free_pointer`Nobuyoshi Nakada
This function has been used wrongly always at first, "allocate a buffer then wrap it with tmpbuf". This order can cause a memory leak, as tmpbuf creation also can raise a NoMemoryError exception. The right order is "create a tmpbuf then allocate&wrap a buffer". So the argument of this function is rather harmful than just useless. TODO: * Rename this function to more proper name, as it is not used "temporary" (function local) purpose. * Allocate and wrap at once safely, like `ALLOCV`.
2019-10-04iseq.c (rb_iseq_compile_on_base): RemovedYusuke Endoh
ko1 cannot remember why he introduced the function. And it is not used. After it is removed, the argument "base_block" of rb_iseq_compile_with_option is always zero.
2019-10-04array.c (rb_mem_clear): remove "register" from argumentsYusuke Endoh
to suppress the following warning: ``` compiling cxxanyargs.cpp In file included from cxxanyargs.cpp:1: In file included from ../../.././include/ruby/ruby.h:2150: ../../.././include/ruby/intern.h:56:19: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] void rb_mem_clear(register VALUE*, register long); ^~~~~~~~~ ../../.././include/ruby/intern.h:56:36: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] void rb_mem_clear(register VALUE*, register long); ^~~~~~~~~ ```
2019-10-04Remove call-seq for method that doesn't exist (#2521)Alan Wu
``` $ ruby -ve 'IO.popen("ls"){}; $?.to_int' ruby 2.6.4p104 (2019-08-28 revision 67798) [x86_64-darwin18] Traceback (most recent call last): -e:1:in `<main>': undefined method `to_int' for #<Process::Status: pid 33989 SIGPIPE (signal 13)> (NoMethodError) Did you mean? to_i taint ``` Process::Status#to_int was removed at 7ba5c4e.
2019-10-03Revert "Simplify bin_path_spec.rb guard"Takashi Kokubun
This reverts commit a56d742e69aa8a3a1fe92fc515d93f6e51cf5fbc. I was checking the CI result of the wrong revision. It actually worked fine https://ci.appveyor.com/project/ruby/ruby/builds/27866303. Never mind...
2019-10-03Simplify bin_path_spec.rb guardTakashi Kokubun
For some reason the guard_not seems not working as expected https://ci.appveyor.com/project/ruby/ruby/builds/27866153/job/v6wa6q6p7b7n7r37
2019-10-03Ignore arm32 failure for nowTakashi Kokubun
2019-10-03bin_path_spec.rb has failed from the beginningTakashi Kokubun
for mswin. This spec is not valid for mswin platform. https://ci.appveyor.com/project/ruby/ruby/builds/27748774/job/85khngfpc806m5lj
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