aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* `$SAFE` as a process global state. [Feature #14250]ko12017-12-2833-118/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * vm_core.h (rb_vm_t): move `rb_execution_context_t::safe_level` to `rb_vm_t::safe_level_` because `$SAFE` is a process (VM) global state. * vm_core.h (rb_proc_t): remove `rb_proc_t::safe_level` because `Proc` objects don't need to keep `$SAFE` at the creation. Also make `is_from_method` and `is_lambda` as 1 bit fields. * cont.c (cont_restore_thread): no need to keep `$SAFE` for Continuation. * eval.c (ruby_cleanup): use `rb_set_safe_level_force()` instead of access `vm->safe_level_` directly. * eval_jump.c: End procs `END{}` doesn't keep `$SAFE`. * proc.c (proc_dup): removed and introduce `rb_proc_dup` in vm.c. * safe.c (rb_set_safe_level): don't check `$SAFE` 1 -> 0 changes. * safe.c (safe_setter): use `rb_set_safe_level()`. * thread.c (rb_thread_safe_level): `Thread#safe_level` returns `$SAFE`. It should be obsolete. * transcode.c (load_transcoder_entry): `rb_safe_level()` only returns 0 or 1 so that this check is not needed. * vm.c (vm_proc_create_from_captured): don't need to keep `$SAFE` for Proc. * vm.c (rb_proc_create): renamed to `proc_create`. * vm.c (rb_proc_dup): moved from proc.c. * vm.c (vm_invoke_proc): do not need to set and restore `$SAFE` for `Proc#call`. * vm_eval.c (rb_eval_cmd): rename a local variable to represent clearer meaning. * lib/drb/drb.rb: restore `$SAFE`. * lib/erb.rb: restore `$SAFE`, too. * test/lib/leakchecker.rb: check `$SAFE == 0` at the end of tests. * test/rubygems/test_gem.rb: do not set `$SAFE = 1`. * bootstraptest/test_proc.rb: catch up this change. * spec/ruby/optional/capi/string_spec.rb: ditto. * test/bigdecimal/test_bigdecimal.rb: ditto. * test/fiddle/test_func.rb: ditto. * test/fiddle/test_handle.rb: ditto. * test/net/imap/test_imap_response_parser.rb: ditto. * test/pathname/test_pathname.rb: ditto. * test/readline/test_readline.rb: ditto. * test/ruby/test_file.rb: ditto. * test/ruby/test_optimization.rb: ditto. * test/ruby/test_proc.rb: ditto. * test/ruby/test_require.rb: ditto. * test/ruby/test_thread.rb: ditto. * test/rubygems/test_gem_specification.rb: ditto. * test/test_tempfile.rb: ditto. * test/test_tmpdir.rb: ditto. * test/win32ole/test_win32ole.rb: ditto. * test/win32ole/test_win32ole_event.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: empty iseq namesnobu2017-12-281-1/+4
| | | | | | | * proc.c (proc_binding): unified the name and realpath of an empty iseq. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* erb.rb: let's remove constant deprecated at 2.5k0kubun2017-12-281-4/+0
| | | | | | (r59497). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix KeyError#{key,receiver} of Thread#fetchkazu2017-12-282-2/+4
| | | | | | [ruby-core:84508] [Bug #14247] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove empty spec/rubyspec directorynormal2017-12-270-0/+0
| | | | | | | | * spec/rubyspec: remove empty directory trees [ruby-core:84533] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update to ruby/spec@b95d7ederegon2017-12-271-11/+26
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update to ruby/spec@0fe33aceregon2017-12-27162-621/+1267
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-12-28svn2017-12-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update to ruby/mspec@5f563e4eregon2017-12-272-4/+26
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix concurrent test.ko12017-12-271-19/+11
| | | | | | | | | | | * test/rubygems/test_require.rb (test_concurrent_require): Synchronizations should be in ensure clause. Sometimes `require` fails (not sure why) and latch is not released. Such case introduces unlimited awaiting. This patch soleve this problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix fd mask detection on os xnobu2017-12-271-1/+2
| | | | | | | | | This was broken in r59440 (3215b27a9abd8de793cf517f32d8901fd421eb1c) [Bug #14248] From: Stefan Kaes <skaes@railsexpress.de> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/downloader.rb: don't suppress exceptionk0kubun2017-12-271-0/+2
| | | | | | | | on the end of retry failure. Fixed mistake in r61498 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/downloader.rb: retry downloadsk0kubun2017-12-271-2/+19
| | | | | | | | | | | because it's randomly failing on CI like https://ci.appveyor.com/project/ruby/ruby/build/1.0.6724 Actually I'm not sure whether the exception class is Errno::ECONNREFUSED or not. Please change the rescued exception to the correct one if it's wrong. I changed to log exception class too in this commit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* erb.rb: preserve the behavior for invalid syntaxk0kubun2017-12-272-13/+11
| | | | | | | | | | | | | | | comment. Fix regression at r58948. I even don't want to deprecate it because deprecation needs to lex all embedded Ruby script using Ripper and it would be slow. So Let me just keep this behavior of Ruby 2.4. No change is the best compatibility. This commit stopped using String#-@ because it's harmful for "ambiguous first argument" warning if we really want to maintain this behavior. [Bug #14243] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec_helper.rb: libruby.so iff enable-sharednobu2017-12-271-1/+1
| | | | | | | * spec/ruby/optional/capi/spec_helper.rb (compile_extension): search libruby.so only when enable-shared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c: expanded eval_stringnobu2017-12-271-13/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c: split eval_string_with_crefnobu2017-12-271-44/+41
| | | | | | | * vm_eval.c (eval_string_with_cref): split into cref and scope modes, which are exclusive. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c: refactor eval_make_iseqnobu2017-12-271-34/+28
| | | | | | | * vm_eval.c (eval_make_iseq): moved preparations of location and debug print. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec_helper.rb: must find libruby.sonobu2017-12-271-11/+14
| | | | | | | | * spec/ruby/optional/capi/spec_helper.rb (compile_extension): if libruby.so should have been built but is not found, fail early. get mtime of the library just once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fake.rb: set libdirnobu2017-12-271-0/+1
| | | | | | | * tool/fake.rb: set "libdir" to build directory too, so that spec/ruby/optional/capi/spec_helper.rb can find libruby_so. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-12-27svn2017-12-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] Fix typos in downcase [ci skip]kazu2017-12-271-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add NEWS for Ruby 2.6.0kazu2017-12-261-0/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Move from NEWS to doc/NEWS-2.5.0kazu2017-12-261-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_proc.rb: remove duplicate test_source_locationnobu2017-12-261-6/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c: fix super in refined modulenobu2017-12-262-2/+44
| | | | | | | | | * vm_method.c (rb_method_entry_complement_defined_class): clone the original method entry of refined module instance method with the active ICLASS, to track super method chain. [ruby-dev:50390] [Bug #14232] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: warning for locationsnobu2017-12-263-4/+52
| | | | | | | | * parse.y (gettable_gen): warn for __FILE__/__LINE__ when eval with binding only. promote use of Binding#source_location instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c: strange message in evalnobu2017-12-262-40/+10
| | | | | | | | * vm_eval.c (eval_string_with_cref): remove unnecessary location from exception backtrace in eval. [ruby-core:84434] [Bug #14229] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_proc.rb: Add a test for Binding#source_locationmame2017-12-261-0/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c (bind_location): Add Binding#source_locationmame2017-12-262-1/+21
| | | | | | Fixes #14230 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: public rb_autoloadnobu2017-12-261-1/+1
| | | | | | | * variable.c (rb_autoload): restore the visibility for backward compatibility. [ruby-core:84454] [Bug #14236] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prelude.c.tmpl: get rid of errors with old gccnobu2017-12-251-6/+6
| | | | | | | * template/prelude.c.tmpl: moved diagnostic pragmas outside prelude_eval() for very old gcc. [ruby-core:84449] [Bug #14234] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-12-26svn2017-12-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_process.rb: get rid of timing issuenobu2017-12-251-3/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c: fix comment to follow field name changek0kubun2017-12-251-1/+1
| | | | | | saved_thread was renamed to saved_ec in r59831 [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* version.h (RUBY_VERSION): 2.6.0 development has started.matz2017-12-252-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c: prime2nobu2017-12-251-3/+3
| | | | | | | * hash.c (prime2): turned into a uint32_t prime, as the lower 32bits, non-prime part only was used always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c: use uint128_tnobu2017-12-251-1/+1
| | | | | | | | | * hash.c (mult_and_mix): use uint128_t instead of __uint128_t. [ruby-core:84438] [Bug #14231] From: Nobuyoshi Nakada <nobu@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use UINT128_T support flag from configurenobu2017-12-251-1/+1
| | | | | | | | | | | | | | | | | Current check for __uint128_t in hash.c is not valid, since it ignores compilers other than gcc. We hit this on lcc on e2k platform. Configure script properly checks from 128-bit data types support and sets HAVE_UINT128_T accordingly. This approach is already used within ruby at bignum.c, random.c, etc. Probably hash.c is an overlooked remnant of old days. This patch fixes this. [ruby-core:84438] [Bug #14231] [Fix GH-1781] From: Andrew Savchenko <bircoph@altlinux.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add ruby_2_5 branch to .travis.ymlnaruse2017-12-251-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* irb.rb: fix highlightnobu2017-12-251-1/+3
| | | | | | | * lib/irb.rb (IRB::Irb#eval_input): fix highlight for multiple lines exception messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix leaked fdsnobu2017-12-251-1/+9
| | | | | | | * lib/rubygems/command.rb (Gem::Command#invoke_with_build_args): restore UI and close the created SilentUI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* doc/contributing.rdoc: Update platform maintainersmame2017-12-251-4/+2
| | | | | | | * mswin32 and Symbian OS are no longer supported * Mac OS X was renamed git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Disasm output contains code range.ko12017-12-251-2/+6
| | | | | | | | * iseq.c (iseq_inspect): show also code range information. Note that `iseq_inspect` is used only for header of disasm. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prelude.rb: block passingnobu2017-12-251-4/+2
| | | | | | | * prelude.rb (Thread.exclusive): pass the block as a block argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* NEWS: Fix typos [ci skip]kazu2017-12-251-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prelude.c.tmpl: static literalsnobu2017-12-251-7/+8
| | | | | | | * template/prelude.c.tmpl (PRELUDE_STR): make string objects with static literals not to copy them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prelude.c.tmpl: fix optimization optionsnobu2017-12-251-1/+9
| | | | | | | | * template/prelude.c.tmpl (prelude_eval): fix optimization options. trace_instruction member has been removed. filled coverage_enabled and debug_level members instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Added gemification entry to NEWS file.hsbt2017-12-251-0/+20
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Set first line numbers for empty iseqs.ko12017-12-252-1/+36
| | | | | | | | | | | | | * compile.c (iseq_compile_each): for empty method, block and so on, `last_line` is not set so that line number of `putnil` instruction will be zero. This patch set `first_lineno` for such `putnil`. Problem is reported by deivid-rodriguez via Yuichiro Kaneko. * test/ruby/test_iseq.rb: add a test for this spec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e