merge revision(s) r46649: [Backport #10005]

	* node.c (dump_node): handle nd_value == (NODE *)-1 to mean this
	  keyword argument is required


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r44577,r45097,r45330,r45331,r45354,r45356: [Backport #10033]

	cptr.c: unused variable

	* ext/dl/cptr.c (rb_dlptr_inspect): remove no longer used variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r44610,r44617:

	numeric.c: preserve encoding

	* numeric.c (coerce_failed): preserve encoding of error message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46465,r46469,r46484: [Backport #9961]

	* vm.c (rb_vm_rewind_cfp): add new function to rewind specified cfp
	  with invoking RUBY_EVENT_C_RETURN.
	  [Bug #9961]

	* vm_core.h: ditto.

	* eval.c (rb_protect): use it.

	* eval.c (rb_rescue2): ditto.

	* vm_eval.c (rb_iterate): ditto.

	* test/ruby/test_settracefunc.rb: add a test.

	* vm_core.h (rb_name_err_mesg_new): 

	* vm_eval.c (rb_catch_protect): fix same problem of [Bug #9961].

	* vm_eval.c (rb_iterate): ditto.

	* vm_core.h (rb_vm_rewind_cfp): add the prototype declaration.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46345,r46346: [Backport #9903]

	re.c: reduce new strings

	* re.c (match_aref, rb_reg_regsub): reduce new strings creation
  for exceptions.
	* re.c (match_aref, rb_reg_regsub): consider encoding of captured
	  names, encoding-incompatible should not match.
	  [ruby-dev:48278] [Bug #9903]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46550: [Backport #9977]

	* hash.c (ruby_setenv): fix memory leak on Windows, free
	  environment strings block after check for the size.
	  [ruby-dev:48323] [Bug #9977]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46557,r46565: [Backport #9978]

	* hash.c (env_select): fix memory leak and crash on Windows, make
	  keys array first instead of iterating on envrion directly.
	  [ruby-dev:48325] [Bug #9978]
	  keys array first instead of iterating on environ directly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46570: [Backport #9983]

	* hash.c (env_shift): fix memory leak on Windows, free environment
	  strings block always.  [ruby-dev:48332] [Bug #9983]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46585,r46595,r46822: [Backport #9977] [Backport #9978] [Backport #9983]

	test_env.rb: rehearsal

	* test/ruby/test_env.rb (test_memory_leak_{aset,select,shift}):
  have a rehearsal before the main loop.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r45676,r45677: [Backport #9769]

	stringio.c: move GC guard

	* ext/stringio/stringio.c (strio_write): move GC guard after the
  last using position.
	* ext/stringio/stringio.c (strio_write): use rb_str_append to
	  reuse coderange bits other than ASCII-8BIT, and keep
	  taintedness.  [ruby-dev:48118] [Bug #9769]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46775: [Backport #10016]

	* vm_insnhelper.c (vm_callee_setup_keyword_arg): adjust VM stack
	  pointer to get rid of overwriting splat arguments by arguments
	  for `to_hash` conversion.  [ruby-core:63593] [Bug #10016]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46382,r46384,r46913: [Backport #9914]

	* io.c (rb_io_advise): AIX currently does not support a 32-bit call to
	  posix_fadvise() if _LARGE_FILES is defined. Patch by Rei Odaira.
	  [ruby-core:62968] [Bug #9914]

	* configure.in (posix_fadvise): disable use of posix_fadvise
	  itself on 32-bit AIX.  [ruby-core:62968] [Bug #9914]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46151,r46165: [Backport #9865]

	* io.c (rb_io_fileno, rb_io_inspect): non-modification does not
	  error on frozen IO.  [ruby-dev:48241] [Bug #9865]

	* io.c (rb_io_autoclose_p): Don't raise on frozen IO.

	* test/lib/minitest/unit.rb: IO#autoclose? may raise IOError.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46241: [Backport #9875]

	* lib/erb.rb (result): [DOC] no longer accepts a Proc, as
	  Kernel.eval does not.  [fix GH-619]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46408,r46410,r46413,r46414,r46424,r46436,r46437: [Backport #9934]

	string.c: shrink too big buffer

	* string.c (rb_str_resize): shrink the buffer even if new length
  is same but it is enough smaller than the capacity.
	* file.c (expand_path): shrink expanded path which no longer needs
	  rooms to append.  [ruby-core:63114] [Bug #9934]

	* string.c (rb_str_resize): should consider the capacity instead
	  of the old length, as pointed out by nagachika.

	* string.c (rb_str_resize): update capa only when buffer get
	  reallocated.
	  http://d.hatena.ne.jp/nagachika/20140613/ruby_trunk_changes_46413_46420#r46413


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46481: [Backport #9966]

	* encoding.c (enc_find): [DOC] never accepted a symbol.
	  [ruby-dev:48308] [Bug #9966]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge r46831 partially. extracted commits are as follows.
https://github.com/k-takata/Onigmo/commit/b9fba1dc63ccb42a86e934011b468e6022fabb74
https://github.com/k-takata/Onigmo/commit/c1fc76b9bd463948ffc5058bc352bf93732f0314
https://github.com/k-takata/Onigmo/commit/a0efc0a200f7108ca3d5ac3039c8f952e0051619
https://github.com/k-takata/Onigmo/commit/c7cda4ed5676167b0d01bb5555724f6164fbdb13
[Bug #8716]

* include/ruby/oniguruma.h (ONIG_MAX_CAPTURE_GROUP_NUM,
  ONIGERR_TOO_MANY_CAPTURE_GROUPS): add cheking the number of capture
  groups.

* regerror.c (onig_error_code_to_format): ditto.

* regparse.c (scan_env_add_mem_entry): ditto.

* regexec.c (onig_region_copy, match_at): fix: segmation fault occurs
  when many groups are used.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r45349,r45837,r45838: [Backport #9521] [Backport #9682]

	* lib/time.rb: [DOC] Fix timezone in example of Time.parse [Bug #9521]
	  Based on patch by @stomar

	* lib/time.rb (Time.parse): [DOC] Fix an example in the documentation.
	  Reported by Marcus Stollsteimer.
	  [ruby-core:60778] [Bug #9521] and [ruby-core:61718] [Bug #9682]

	* lib/time.rb (Time.parse): [DOC] Fix an example in the documentation
	  to use EST.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r45542,r45543: [Backport #9717]

	* gc.c (mark_current_machine_context): Call SET_STACK_END.
	  This reverts a hunk of r40703 by ko1.
	  This fixes [ruby-dev:48098] [Bug #9717].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46896,r46897,r46898: [Backport #10078]

	* string.c (rb_str_count): fix wrong single-byte optimization.
	  7bit ascii can be a trailing byte in Shift_JIS.
	  [ruby-dev:48442] [Bug #10078]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e