Граф коммитов

48411 Коммитов

Автор SHA1 Сообщение Дата
nobu fe3decb201 process.c: removed preserving_errno
* process.c (try_with_sh, handle_fork_error): added argument for
  errno.

* process.c (proc_exec_cmd, proc_exec_sh, exec_async_signal_safe):
  now return errno instead of -1.

* process.c (rb_fork_ruby): merged retry_fork_ruby() and unified
  clean-up after fork regardless failure.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-14 04:42:38 +00:00
nobu 73e41247b9 string.c: prefer rb_syserr_fail
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-14 03:02:58 +00:00
nobu a48fac6e22 common.mk: add dependencies for iseq.h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-14 03:00:23 +00:00
nobu 9cabbf849e compile.c: comments for concatstrings optimization [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-14 02:40:04 +00:00
ko1 77c301073b use RUBY_API_VERSION as ISEQ versions.
* iseq.h: use RUBY_API_VERSION_MAJOR for ISEQ_MAJOR_VERSION and
  RUBY_API_VERSION_MINOR for ISEQ_MINOR_VERSION.
  We need to keep compatibility for ISeq during same major/minor versions.
  If we need to change compatibility between teeny versions, we should use
  (RUBY_API_VERSION_MINOR * 10 + iseq revs) for ISEQ_MINOR_VERSION.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-14 01:37:41 +00:00
svn 23b8130c45 * 2017-11-14
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-13 23:53:01 +00:00
nobu 496b4267b2 compile.c: fixup r60727
* compile.c (iseq_peephole_optimize): skip next `freezestring`
  instruction after `concatstrings` instruction when frozen string
  literal is enabled.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-13 23:53:00 +00:00
nobu 24d38cc447 regexec.c: invalidate previously matched position
* regexec.c (match_at): invalidate end position not yet matched
  when new start position is pushed, to dispose previously stored
  position.  [ruby-core:83743] [Bug #14101]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-13 05:50:54 +00:00
nobu 0c467565ca test_regexp.rb: test_absent
* test/ruby/test_regexp.rb (test_absent): add simple tests for
  absent operator.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-13 05:46:30 +00:00
nobu fdb64a1a44 envutil.rb: preserve RUBYLIB
* test/lib/envutil.rb (invoke_ruby): preserve RUBYLIB which is
  set by runruby.rb and necessary to load standard libraries.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-13 01:58:18 +00:00
yui-knk 8020a87df0 Print last location of a node
* node.c (A_NODE_HEADER): Print last location of a node.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-13 01:24:16 +00:00
yui-knk 43e15e77b9 Initialize last column with -1 and lineno with 0
* parse.y (node_newnode): Initialize last column of nodes
  with -1 and lineno with 0 to make it easy to detect nodes
  which we forget to set a column number or lineno.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-13 01:24:15 +00:00
yui-knk 1ef7b0cd5a Store last location of a node on RNode
* node.c (rb_node_init): Initialize last location with 0.

* node.h (struct rb_code_range_struct): Define a structure
  which contains first location and last location of a node.
* node.h (struct RNode): Use rb_code_range_t to store last
  location of a node.
* node.h (nd_column, nd_set_column, nd_lineno, nd_set_lineno):
  Follow-up the change of struct RNode.
* node.h (nd_last_column, nd_set_last_column, nd_last_lineno, nd_set_last_lineno):
  Define getter/setter macros for last location of RNode.

* parse.y : Set last location of tokens.

Thanks to Yusuke Endoh (mame) for design of data structures.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-13 00:14:33 +00:00
rhe a82aaea719 string.c: fix up r60748
An #ifdef was missing in r60748 and build broke on systems without
crypt_r().

https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20171112T162503Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-12 17:10:29 +00:00
rhe 0b845a8458 string.c: fix memory leak in String#crypt
Use ALLOCV to allocate struct crypt_data for slightly cleaner and less
error-prone code. It is currently possible it leaks when an invalid
argument is passed to String#crypt or rb_str_new_cstr() fails to
allocate memory.

SIZEOF_CRYPT_DATA macro in missing/crypt.h is removed since it is not
used any longer.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-12 15:55:04 +00:00
svn 4eb3457076 * 2017-11-13
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-12 15:25:57 +00:00
k0kubun f77fc95cf2 .gitignore: ignore dlntest.dll
This was generated with in-place build on MinGW and not ignored.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-12 15:25:56 +00:00
kazu e3fcf44afe Clarify Dir.mktmpdir's change
`FileUtils.remove_entry_secure` checks `world_writable?` (and `sticky?`) only.
[ci skip]
ref https://github.com/rurema/doctree/pull/805

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-12 07:05:58 +00:00
svn 6f3ca72cb8 * 2017-11-12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-12 04:45:52 +00:00
nobu 7a693278c2 load.c: cwd encoding
* load.c (rb_get_expanded_load_path): save cwd cache in OS path
  encoding, to get rid of unnecessary conversion and infinite
  loading when it needs encoding conversion.
  [ruby-dev:50221] [Bug #13863]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-12 04:45:51 +00:00
nobu 74597b0b4b parse.y: constified YYLTYPE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-11 04:50:11 +00:00
svn 8bec8af2ff * 2017-11-11
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-11 03:57:03 +00:00
suke 856aca46b7 * ext/win32ole/win32ole.c(ole_const_load): suppress constant redefinition
warnings when WIN32OLE.const_load [Bug #14085]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-11 03:57:02 +00:00
k0kubun e16bd0f4d8 bin/erb: change template file encoding to UTF-8
Unlike Ruby source file encoding (script encoding) whose default is
changed to UTF-8 in Ruby 2.0 (Feature #6679), template's file encoding
given to erb(1) has been ASCII-8BIT since ERB supports m17n at r21170.

Like Ruby source file encoding, erb template file encoding should be
UTF-8 in Ruby 2.

[Bug #14095] [ruby-core:83708]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-10 13:59:01 +00:00
kazu 7dae879770 Fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-10 13:50:14 +00:00
mame 139eb4e862 Make `rb_ast_dispose` use `RB_OBJ_WRITE`
This fixes the mistake of r60722.
I used `rb_gc_writebarrier_remember` to notify to GC that the references
is changed.  But the function just adds the object to the remember set
blindly.  Ko1 told me that `RB_OBJ_WRITE` is suitable in this case.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-10 13:46:38 +00:00
k0kubun 4d60654690 .travis.yml: workaround to resolve ::1
Container-based Trusty environment (sudo: false) does not support IPv6.
https://github.com/travis-ci/travis-ci/issues/3302

And the image has "::1  localhost ip6-localhost ip6-loopback" entry in
addition to "127.0.0.1 localhost" in /etc/hosts.
Thus when it can resolve localhost to ::1 and CI fails.

To resolve this, at least we need to modify /etc/hosts for now but we
can't modify /etc/hosts without sudo.

So I enabled sudo. As Sudo-enabled VM didn't have "::1 localhost" entry,
this change fixed the cause without touching /etc/hosts.

Since boot of `sudo: required` is slower than `sudo: false`, please revert
this commit anytime when Container-based Trusty environment is updated and
::1 issue has gone.
https://docs.travis-ci.com/user/reference/overview/

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-10 11:50:00 +00:00
nobu 54b8b8e4f7 iseq.c: disasm only once for each iseq
* iseq.c (rb_iseq_disasm): do not dump repeatedly same iseq which
  has been dumped by catch tables.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-10 08:26:44 +00:00
hsbt 9b41c2af6d Do not define test method instead of skip when Calendar class is not defined.
Revisit r34739. Patch by MSP-Greg.
  [Bug #14088][ruby-core:83690][fix GH-1743]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-10 06:31:36 +00:00
ko1 61e4c99962 refactoring about source line.
* iseq.c (find_line_no): renamed to rb_iseq_line_no().

* vm_backtrace.c (calc_lineno): add a comment why we need to use "pos-1".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-10 05:26:52 +00:00
nobu 324b6d306d iseq.c: operand lvar
* iseq.c (rb_insn_operand_intern): show local variable operand
  name in unified instructions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 23:08:01 +00:00
nobu 6820727a90 mk_call_iseq_optimized.rb: add mode string [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 23:02:52 +00:00
marcandre 3527c863be lib/matrix: Remove method catalog [doc] [ci-skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 22:05:44 +00:00
svn 6e3126d33d * 2017-11-10
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 22:04:48 +00:00
marcandre a5abde57b8 TracePoint.new: raise ArgumentError when no block given [#14074]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 22:04:47 +00:00
nobu 7b1f3906a0 compile.c: optimize nested string interpolations
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 08:27:01 +00:00
ko1 1c5ae5a163 insn_info/insns_info
* iseq.h (iseq_line_info_entry): rename to iseq_insn_info_entry.

* vm_core.h (rb_iseq_constant_body): rename field name line_info_table
  to insns_info and also from line_info_size to insns_info_size.

* compile.c (INSN): add struct insn_info to contain per insn information.

* compile.c (add_insn_info): added to add new insn_info entry.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 06:57:24 +00:00
ko1 3b7373fd00 fix backtrace on argment error.
* vm_backtrace.c (rb_backtrace_use_iseq_first_lineno_for_last_location):
  added. It modifies last location's line as corresponding iseq's first line
  number.

* vm_args.c (raise_argument_error): use added function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 05:22:51 +00:00
ko1 976b6df959 fix peephole optimization.
* compile.c (iseq_peephole_optimize): do not need to put `pop`
  instruction.

* test/ruby/test_optimization.rb (test_peephole_optimization_without_trace):
  This code "def foo; 1.times{|(a), &b| nil && a}; end" fails to compile
  by stack underflow because of above bug (fixed by this patch).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 04:27:27 +00:00
mame 2b60e342bd node.c (dump_node): add an explanation of NODE_HASH's nd_alen
The field has a flag to represent if it is a keyword argument (that has
no braces, e.g., `foo(k:1)`) or hash literal (that has braces, e.g.,
`foo({k:1})`).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 01:50:58 +00:00
mame f09ad1dc5d use `rb_ast_dispose` instead of `rb_ast_free`
`rb_ast_dispose` calls `rb_gc_writebarrier_remember`.  Unless we call
it, the marked objects may not be GC'ed until `rb_ast_t` is GC'ed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 01:32:11 +00:00
hsbt 3ba9e6b639 Merge rubygems-2.7.2.
This version fixes some setup commands.
  01e797f6aa/History.txt (L3)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 00:42:19 +00:00
nobu cf3329cb8d parse.y: fix r60644
* parse.y (rb_strterm_heredoc_t): should not define sourceline as
  union, to fix wrong read on big-endian platforms.
  as rb_imemo_new stores all members as VALUEs, should read it as
  VALUE too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 23:09:25 +00:00
svn b887848188 * 2017-11-09
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 16:43:24 +00:00
a_matsuda d3b63f9597 Fix typo in doc [ci skip]
`enable` and `disable` are instance methods.

Patch by: yuuji.yaginuma <yuuji.yaginuma@gmail.com>

https://github.com/ruby/ruby/pull/1744
[Fix GH-1744]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 16:43:23 +00:00
kazu fb5bc568ca fixup r60440 [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 14:14:54 +00:00
nobu e7d37ebdae parse.y: remove in_single
* parse.y (parser_params): removed in_single, which is referenced
  with in_def always.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 10:54:09 +00:00
knu b0c719dae4 Fix typos in rdoc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 03:57:54 +00:00
yui-knk a6f372d129 Omit first argument of NEW_CASE2
* node.h (NEW_CASE2): Omit first argument of NEW_CASE2,
  bacause the first argument of NEW_CASE2 is always 0.
* parse.y: Ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 00:03:02 +00:00
stomar 6f33cde636 hash.c: improve docs for Hash#slice
* hash.c: [DOC] clarify description for Hash#slice and remove
  a sentence that might suggest that the receiver is modified;
  improve example to also include a case where a hash with
  several elements is returned.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:17:04 +00:00