------------------------------------------------------------------------
r59899 | nagachika | 2017-09-14 20:25:09 +0900 (Thu, 14 Sep 2017) | 1 line

add tag v2_4_2
------------------------------------------------------------------------
r59898 | nagachika | 2017-09-14 20:24:10 +0900 (Thu, 14 Sep 2017) | 6 lines

merge revision(s) 59897:

	lib/webrick/log.rb: sanitize any type of logs

	It had failed to sanitize some type of exception messages.  Reported and
	patched by Yusuke Endoh (mame) at https://hackerone.com/reports/223363
------------------------------------------------------------------------
r59841 | nagachika | 2017-09-12 02:27:01 +0900 (Tue, 12 Sep 2017) | 7 lines

merge revision(s) 59375: [Backport #13756]

	parse.y: empty hash in defined

	* parse.y (command): NODE_ARRAY with NULL is invalid.  traversal
	  in defined_expr0 is simplified than iseq_compile_each0.
	  [ruby-core:82113] [Bug #13756]
------------------------------------------------------------------------
r59823 | nagachika | 2017-09-10 21:33:09 +0900 (Sun, 10 Sep 2017) | 6 lines

merge revision(s) 59765: [Backport #13877]

	ruby.h: unnormalized Fixnum value

	* include/ruby/ruby.h (ST2FIX): fix unnormalized Fixnum value bug
	  on mingw/mswin.  [ruby-core:82687] [Bug #13877]
------------------------------------------------------------------------
r59822 | nagachika | 2017-09-10 21:17:49 +0900 (Sun, 10 Sep 2017) | 7 lines

merge revision(s) 59763: [Backport #13874]

	string.c: fix false coderange

	* string.c (rb_enc_str_scrub): enc can differ from the actual
	  encoding of the string, the cached coderange is useless then.
	  [ruby-core:82674] [Bug #13874]
------------------------------------------------------------------------
r59820 | nagachika | 2017-09-10 19:27:59 +0900 (Sun, 10 Sep 2017) | 6 lines

merge revision(s) 59644: [Backport #13836]

	parse.y: primary should not be 0

	* parse.y (primary): should not be 0, since it can be a receiver.
	  [ruby-core:82447] [Bug #13836]
------------------------------------------------------------------------
r59819 | nagachika | 2017-09-10 19:10:28 +0900 (Sun, 10 Sep 2017) | 7 lines

merge revision(s) 59613: [Backport #13817]

	vm_method.c: alias warning at refined method

	* vm_method.c (rb_method_entry_make): suppress a warning at
	  refined method which will not be redefined.
	  [ruby-core:82385] [Bug #13817]
------------------------------------------------------------------------
r59818 | nagachika | 2017-09-10 15:15:05 +0900 (Sun, 10 Sep 2017) | 2 lines

revert r59813 partially. TestGemRequire#test_realworld_default_gem is not contained in trunk. 
I would like to sync rubygems on ruby_2_4 branch to trunk
------------------------------------------------------------------------
r59817 | nagachika | 2017-09-10 15:03:12 +0900 (Sun, 10 Sep 2017) | 6 lines

merge revision(s) 59649: [Backport #13832]

	gc.c: restore cfp at finalizer

	* gc.c (run_finalizer): restore cfp for the case an exception
	  raised in a finalizer.  [ruby-core:82432] [Bug #13832]
------------------------------------------------------------------------
r59816 | nagachika | 2017-09-10 14:44:27 +0900 (Sun, 10 Sep 2017) | 1 line

revert r59815 partially.
------------------------------------------------------------------------
r59815 | nagachika | 2017-09-10 14:36:09 +0900 (Sun, 10 Sep 2017) | 1 line

bump up RUBY_PATCHLEVEL
------------------------------------------------------------------------
r59814 | nagachika | 2017-09-10 14:23:13 +0900 (Sun, 10 Sep 2017) | 3 lines

lib/rubygems: fix several vulnerabilities in RubyGems; bump to version 2.6.13.
[Backport #13842]

------------------------------------------------------------------------
r59813 | nagachika | 2017-09-10 14:10:55 +0900 (Sun, 10 Sep 2017) | 2 lines

lib/rubygems: bump up RubyGems version to 2.6.12. [Backport #13842]

------------------------------------------------------------------------
r59812 | nagachika | 2017-09-10 13:53:58 +0900 (Sun, 10 Sep 2017) | 6 lines

merge revision(s) 59708: [Backport #13844]

	compile.c: ensure after toplevel return

	* compile.c (iseq_compile_each0): toplevel returns should fire
	  ensures.  [ruby-core:82492] [Bug #13844]
------------------------------------------------------------------------
r59811 | nagachika | 2017-09-10 12:49:10 +0900 (Sun, 10 Sep 2017) | 15 lines

merge revision(s) 59624,59626: [Backport #13830]

	ruby.h: fix rb_scan_args_trail_idx

	* include/ruby/ruby.h (rb_scan_args_trail_idx): fix the case both
	  of optional and rest arguments are defined.
	  [ruby-core:82427] [Bug #13830]

	* include/ruby/ruby.h (rb_scan_args_n_trail): ditto.
	non-keywords hash

	* class.c (rb_scan_args), include/ruby/ruby.h (rb_scan_args_set):
	  return non-keywords elements only in the last hash when keyword
	  arguments are extracted from it, as well as methods defined in
	  ruby level.  [ruby-core:82427] [Bug #13830]
------------------------------------------------------------------------
r59809 | nagachika | 2017-09-10 11:58:23 +0900 (Sun, 10 Sep 2017) | 14 lines

merge revision(s) 59322,59325: [Backport #13744]

	process.c: handle dynamic :rlimit_* symbols in spawn execopts

	* process.c (rb_execarg_addopt_rlimit): hoist out of rb_execarg_addopt
	  (rlimit_type_by_sym): new wrapper for dynamic symbol
	  (rb_execarg_addopt): check for dsym via rlimit_type_by_sym
	* test/ruby/test_process.rb (test_execopts_rlimit): check dsym w/o pindown
	  Add extra check for bogus rlimit args, too.
	  [ruby-core:82033] [Bug #13744]
	process.c: null bytes

	* process.c (rlimit_type_by_sym): prohibit null bytes in key
	  names.  [ruby-core:82033] [Bug #13744]
------------------------------------------------------------------------
r59808 | nagachika | 2017-09-10 11:46:34 +0900 (Sun, 10 Sep 2017) | 7 lines

merge revision(s) 57944,57977,58062: [Backport #13306]

	io.c: [DOC] IO#puts uses IO#write
	io.c: [DOC] add missing `$`
	io.c: [DOC] expand docs for IO#puts

	[ruby-core:80081] [Bug #13306]
------------------------------------------------------------------------
r59807 | nagachika | 2017-09-10 11:40:45 +0900 (Sun, 10 Sep 2017) | 24 lines

merge revision(s) 58524,58525,58526,59333,59337: [Backport #13616]

	zlib.c: zstream_expand_buffer_non_stream

	* ext/zlib/zlib.c (zstream_expand_buffer_non_stream): rename from
	  zstream_expand_buffer_without_gvl() and replace duplicate code
	  in zstream_expand_buffer().
	zlib.c: zstream_buffer_ungetbyte

	* ext/zlib/zlib.c (zstream_buffer_ungetbyte): simplify by using
	  zstream_buffer_ungets().
	zlib.c: no buf_filled in zstream

	* ext/zlib/zlib.c (zstream): manage capacity and size of `buf`
	  instead of size and separated member `buf_filled`.  reported by
	  Christian Jalio (jalio) at https://hackerone.com/reports/211958
	Zlib::GzipReader#pos underflows after calling #ungetbyte or #ungetc at start of file [Bug #13616]

	patched by Andrew Haines <andrew@haines.org.nz> [ruby-core:81488]
	zlib.c: fix unnormalized Fixnum

	* ext/zlib/zlib.c (rb_gzfile_total_out): cast to long not to
	  result in an unsigned long to normalized to Fixnum on LLP64
	  platforms.  [ruby-core:81488]
------------------------------------------------------------------------
r59784 | nagachika | 2017-09-08 23:38:12 +0900 (Fri, 08 Sep 2017) | 28 lines

merge revision(s) 59567: [Backport #13796]

	openssl: import v2.0.5

	Import Ruby/OpenSSL 2.0.5. The full commit history since v2.0.4
	(imported at r59081) can be found at:

		https://github.com/ruby/openssl/compare/v2.0.4...v2.0.5

	This will fix the test failure on latest Debian sid and the "no
	OPENSSL_Applink" issue on mswin.

	----------------------------------------------------------------
	Kazuki Yamaguchi (11):
	      test/test_ssl: allow 3DES cipher suites in test_sslctx_set_params
	      bio: prevent possible GC issue in ossl_obj2bio()
	      bio: do not use the FILE BIO method in ossl_obj2bio()
	      Rakefile: install_dependencies: install only when needed
	      appveyor.yml: test against Ruby 2.4
	      ossl_pem_passwd_cb: relax passphrase length constraint
	      ossl_pem_passwd_cb: do not check for taintedness
	      ossl_pem_passwd_cb: handle nil from the block explicitly
	      ssl: remove unsupported TLS versions from SSLContext::METHODS
	      ssl: fix compile error with OpenSSL 1.0.0
	      Ruby/OpenSSL 2.0.5

	Lars Kanis (1):
	      Add msys2 library dependency tag in gem metadata
------------------------------------------------------------------------
r59783 | nagachika | 2017-09-08 23:27:38 +0900 (Fri, 08 Sep 2017) | 7 lines

merge revision(s) 59693,59695: [Backport #13852]

	A HTTP Header value must not contain CR or LF.
	to_str -> to_s

	* lib/net/http/header.rb (set_field): `val` can not have `to_str`.

------------------------------------------------------------------------
r59782 | nagachika | 2017-09-08 23:25:52 +0900 (Fri, 08 Sep 2017) | 8 lines

merge revision(s) 59584: [Backport #13850]

	REXML: Fix a bug that unexpected methods can be called as a XPath function

	[HackerOne:249295]

	Reported by Andrea Jegher. Thanks!!!

------------------------------------------------------------------------
r59520 | nagachika | 2017-08-05 16:00:33 +0900 (Sat, 05 Aug 2017) | 11 lines

merge revision(s) 59457: [Backport #13775]

	should not copy promoted flags.

	* include/ruby/ruby.h (rb_clone_setup): should not copy some flags
	  (FL_PROMOTED0|FL_PROMOTED1|FL_FINALIZE).
	  [Bug #13775]

	* test/ruby/test_object.rb: add a test (note that this test will fail
	  only when RGENGC_CHECK_MODE >= 2).

------------------------------------------------------------------------
r59517 | nagachika | 2017-08-05 15:46:23 +0900 (Sat, 05 Aug 2017) | 6 lines

merge revision(s) 59368: [Backport #13753]

	random.c: ensure initialized

	* random.c (get_rnd, try_get_rnd): ensure initialized to get rid
	  of crash in forked processes.  [ruby-core:82100] [Bug #13753]
------------------------------------------------------------------------
r59516 | nagachika | 2017-08-05 15:35:02 +0900 (Sat, 05 Aug 2017) | 30 lines

merge revision(s) 59462,59474: [Backport #13772]

	release VM stack properly.

	* cont.c: r55766 change the handling method of Fiber's VM stack.
	  Resumed Fiber points NULL as VM stack and running Thread has
	  responsibility to manage it (marking and releasing).

	  However, thread_start_func_2()@thread.c and thread_free()@vm.c
	  doesn't free the VM stack if corresponding root Fiber is exist.
	  This causes memory leak. [Bug #13772]

	* cont.c (root_fiber_alloc): fib->cont.saved_thread.ec.stack should be NULL
	  because running thread has responsibility to manage this stack.

	* vm.c (rb_thread_recycle_stack_release): assert given stack is not NULL
	  (callers should care it).

	fix stack storing for root fibers.

	* cont.c (root_fiber_alloc): this function is called by fiber_current()
	  and fiber_store(). fiber_current() should clear VM stack information
	  in a fiber data because runnning thread knows stack information and has
	  responsibility to manage it. However fiber_store() requires to remain
	  VM stack information in a fiber data because the responsibility to manage
	  VM stack is moved to the Fiber from the Thread (and switch to another
	  fiber).

	* cont.c (root_fiber_alloc): save thread's fiber and root_fiber information.

------------------------------------------------------------------------
r59515 | nagachika | 2017-08-05 12:24:54 +0900 (Sat, 05 Aug 2017) | 8 lines

merge revision(s) 59128: [Backport #13669]

	Fix Enumerable#uniq with non single yield arguments

	* enum.c (uniq_func, uniq_iter): need packed value as the unique
	  key.  [ruby-core:81734] [Bug #13669] [Fix GH-1658]

	Author:    Kenichi Kamiya <kachick1@gmail.com>
------------------------------------------------------------------------
r59514 | nagachika | 2017-08-05 11:43:08 +0900 (Sat, 05 Aug 2017) | 10 lines

merge revision(s) 58810,58894: [Backport #13578]

	compile.c: fix catch-table labels optimization

	* compile.c (remove_unreachable_chunk): do not eliminate chunks
	  followed by labels in catch-table entries.
	compile.c: fix possible use of uninitialized value

	LABEL::unremovable added by r58810 is not initialized by
	new_label_body(), making the optimization unstable.
------------------------------------------------------------------------
r59513 | nagachika | 2017-08-05 11:22:37 +0900 (Sat, 05 Aug 2017) | 7 lines

merge revision(s) 58561: [Backport #13540]

	parse.y: make shared string modifiable

	* parse.y (dedent_string): ensure that the string is modifiable,
	  not to set the length of shared string.
	  [ruby-core:80987] [Bug #13540]
------------------------------------------------------------------------
r59512 | nagachika | 2017-08-05 10:56:55 +0900 (Sat, 05 Aug 2017) | 11 lines

merge revision(s) 58205: [Backport #13380]

	Remove unused Init_frozen_strings declaration

	Init_frozen_strings definition is removed in r51511.
	https://bugs.ruby-lang.org/issues/11423

	Patch by Kohei Suzuki <eagletmt@gmail.com>

	* internal.h: Remove declaration of unexist function
	  [Fix GH-1558]
------------------------------------------------------------------------
r59511 | nagachika | 2017-08-05 10:53:44 +0900 (Sat, 05 Aug 2017) | 11 lines

merge revision(s) 57501,58576: [Backport #13539]

	escape.c: check argument

	* ext/cgi/escape/escape.c (optimized_unescape): check
	  accept_charset encoding argument.
	share `@@accept_charset`

	* lib/cgi/{core,util}.rb: include CGI::Util not only extending, to
	  share `@@accept_charset` class variable, so that it is always
	  accessible.  [ruby-core:80986] [Bug #13539]
------------------------------------------------------------------------
r59510 | nagachika | 2017-08-05 10:45:39 +0900 (Sat, 05 Aug 2017) | 9 lines

merge revision(s) 58523: [Backport #13528]

	rational.c: canonicalization case

	* rational.c (float_numerator, float_denominator): fix for
	  canonicalization case where `Float#to_r` could return an Integer
	  not a Rational.  although mathn.rb has been removed in the
	  trunk, fix for the backport purpose.
	  [ruby-core:80942] [Bug #13528]
------------------------------------------------------------------------
r59507 | nagachika | 2017-08-05 01:13:13 +0900 (Sat, 05 Aug 2017) | 7 lines

merge revision(s) 59374: [Backport #13755]

	compile.c: restore stack at return

	* compile.c (iseq_compile_each0): restore the stack depth after
	  return to the previous depth, to fix the stack depth at
	  returning from rescue iseq.  [ruby-core:82108] [Bug #13755]
------------------------------------------------------------------------
r59506 | nagachika | 2017-08-05 00:55:45 +0900 (Sat, 05 Aug 2017) | 7 lines

merge revision(s) 59384: [Backport #13759]

	strscan.c: fix segfault in aref

	* ext/strscan/strscan.c (strscan_aref): fix segfault after
	  get_byte or getch which do not apply regexp.
	  [ruby-core:82116] [Bug #13759]
------------------------------------------------------------------------
r59505 | nagachika | 2017-08-05 00:29:45 +0900 (Sat, 05 Aug 2017) | 6 lines

merge revision(s) 58913: [Backport #13599]

	numeric.c: fix for small number

	* numeric.c (flo_floor, flo_ceil): should not return zero for small
	  number.  [ruby-core:81394] [Bug #13599]
------------------------------------------------------------------------
r59504 | svn | 2017-08-05 00:06:23 +0900 (Sat, 05 Aug 2017) | 1 line

* 2017-08-05
------------------------------------------------------------------------
r59503 | nagachika | 2017-08-05 00:06:22 +0900 (Sat, 05 Aug 2017) | 9 lines

merge revision(s) 59063: [Backport #13605]


	* proc.c (get_local_variable_ptr): return found env ptr. Returned env
	  will be used by write barrier at `bind_local_variable_set()'.
	  [Bug #13605]

	* test/ruby/test_proc.rb: add a test for this issue.

------------------------------------------------------------------------
r59501 | nagachika | 2017-08-04 23:39:29 +0900 (Fri, 04 Aug 2017) | 6 lines

merge revision(s) 58287: [Backport #13411]

	configure.in: rpath with OPTDIR

	* configure.in: add rpath flags which is needed for OPTDIR as well
	  as -L options, when it is given.  [ruby-dev:50065] [Bug #13411]
------------------------------------------------------------------------
r59500 | nagachika | 2017-08-04 23:31:52 +0900 (Fri, 04 Aug 2017) | 16 lines

merge revision(s) 59357,59358: [Backport #13391] [Backport #13404]

	proc.c: rb_block_min_max_arity

	* proc.c (rb_block_min_max_arity): new function to get arity range
	  from the current block.
	vm_eval.c: rb_lambda_call

	* enum.c (enum_collect): make the block arity same as the given
	  block.  [Bug #13391]

	* internal.h (vm_ifunc): store arity instead of unused id.

	* proc.c (rb_vm_block_min_max_arity): return ifunc arity.

	* vm_eval.c (rb_lambda_call): call method with lambda block.
------------------------------------------------------------------------
r59493 | nagachika | 2017-08-04 01:00:34 +0900 (Fri, 04 Aug 2017) | 15 lines

merge revision(s) 59183,59184: [Backport #13682]

	fix return in toplevel rescue/ensure

	* compile.c (iseq_compile_each0): throw TAG_RETURN at return in
	  toplevel rescue/ensure to adjust VM stack properly.
	  [ruby-core:81777] [Bug #13682]

	* vm_insnhelper.c (vm_throw_start): allow return in toplevel
	  rescue/ensure.
	fix return in toplevel ensure

	* compile.c (iseq_compile_each0): adjust stack after return in
	  toplevel ensure, when the value is used.
	  [ruby-core:81777] [Bug #13682]
------------------------------------------------------------------------
r59492 | nagachika | 2017-08-04 00:41:24 +0900 (Fri, 04 Aug 2017) | 8 lines

merge revision(s) 59202: [Backport #13690]

	compile.c: disallow next in once

	* compile.c (iseq_compile_each0): turned dregx context in "once"
	  into "guarded" type from "block" type, to disallow `next`,
	  `break`, `redo` as well as outside "once".
	  [ruby-core:81805] [Bug #13690]
------------------------------------------------------------------------
r59491 | nagachika | 2017-08-04 00:40:10 +0900 (Fri, 04 Aug 2017) | 8 lines

merge revision(s) 59181: [Backport #13680]

	vm_insnhelper.c: break in once

	* vm_insnhelper.c (vm_throw_start): size of catch table has been
	  included in iseq_catch_table struct, which could be NULL, since
	  2.2.  e.g., proc-closure in `once'.
	  [ruby-core:81775] [Bug #13680]
------------------------------------------------------------------------
r59490 | nagachika | 2017-08-03 23:00:41 +0900 (Thu, 03 Aug 2017) | 7 lines

merge revision(s) 59169: [Backport #13678]

	compile.c: toplevel return in argument

	* compile.c (iseq_compile_each0): adjust the stack before return
	  in an evstr/argument (reported by Balazs <balazs@kutilovi.cz>)
	  to fix stack consistency error.  [ruby-core:81761] [Bug #13678]
------------------------------------------------------------------------
r59489 | nagachika | 2017-08-03 22:43:01 +0900 (Thu, 03 Aug 2017) | 43 lines

merge revision(s) 58742,59081: [Backport #11033]

	Search SSL libraries by testing various filename patterns

	* ext/openssl/extconf.rb (find_openssl_library): should search by more flexible
	  method, especially for LibreSSL on Windows.

	openssl: import v2.0.4

	Import Ruby/OpenSSL 2.0.4. Only bug (and typo) fixes. The full commit
	history since v2.0.3 (imported at r57482) can be found at:

	  https://github.com/ruby/openssl/compare/v2.0.3...v2.0.4

	This contains the fix for [Bug #11033].

	----------------------------------------------------------------
	Jun Aruga (1):
	      Update .travis.yml and Dockerfile

	Kazuki Yamaguchi (9):
	      test/test_pkey_ec: do not use dummy 0 order
	      test/test_ssl: fix typo in test_sysread_and_syswrite
	      ssl: check return value of SSL_set_fd()
	      Fix typos
	      test/test_x509store: skip OpenSSL::TestX509Store#test_set_errors
	      tool/sync-with-trunk: 'LASY' -> 'LAST'
	      x509store: clear error queue after calling X509_LOOKUP_load_file()
	      extconf.rb: simplify searching libraries logic
	      Ruby/OpenSSL 2.0.4

	SHIBATA Hiroshi (1):
	      Fix typos

	Vladimir Rybas (1):
	      Fix documentation for OpenSSL::Cipher#final

	nobu (2):
	      openssl: fix broken openssl check
	      openssl: fix broken openssl check

	usa (1):
	      Search SSL libraries by testing various filename patterns
------------------------------------------------------------------------
r59488 | nagachika | 2017-08-03 22:29:12 +0900 (Thu, 03 Aug 2017) | 8 lines

merge revision(s) 58503: [Backport #13523]

	node.h: sign-extend

	* node.h (nd_line): should sign-extend.  shifting `VALUE` extends
	  with zero bits if `sizeof(VALUE)` equals to `sizeof(int)`.  the
	  zero bits are truncated if `sizeof(VALUE)` is bigger enough.
	  [ruby-core:80920] [Bug #13523]
------------------------------------------------------------------------
r59409 | nagachika | 2017-07-23 17:59:07 +0900 (Sun, 23 Jul 2017) | 9 lines

merge revision(s) 58641: [Backport #13547]

	parse.y: brace after literal arg

	* parse.y (symbol, dsym, parser_set_number_literal, parser_yylex):
	  set state to END too not only ENDARG and after a literal, so
	  that a left brace after it should be a primary block bound to
	  the literal, which causes syntax error.
	  [ruby-core:81037] [Bug #13547]
------------------------------------------------------------------------
r59408 | nagachika | 2017-07-23 17:49:34 +0900 (Sun, 23 Jul 2017) | 11 lines

merge revision(s) 58902: [Backport #13595]

	attempt to fix rb_alloc_tmp_buffer2 for ALLOCV_N

	This is a confusing function to my arithmetic-challenged mind,
	but nobu seems alright with this.  Anyways this lets me use
	large values of elsize without segfaulting, and "make exam"
	passes.

	* include/ruby/ruby.h (rb_alloc_tmp_buffer2): attempt to fix
	  [ruby-core:81388] [ruby-core:81391] [Bug #13595]
------------------------------------------------------------------------
r59407 | nagachika | 2017-07-23 17:39:46 +0900 (Sun, 23 Jul 2017) | 13 lines

merge revision(s) 58077,58229: [Backport #13358]

	ostruct.rb: fix OpenStruct.allocate

	* lib/ostruct.rb (OpenStruct.allocate): initialize an instance
	  variable directly, without calling `intialize` method which may
	  be overridden in a subclass.  [ruby-core:80292] [Bug #13358]
	ostruct.rb: improve fix for OpenStruct.allocate + #respond_to?

	* lib/ostruct.rb (OpenStruct#respond_to_missing?): this makes
	  OpenStruct#respond_to? works on any OpenStruct instance,
	  just like Kernel#respond_to? does, without workarounds.
	  [ruby-core:80292] [Bug #13358]
------------------------------------------------------------------------
r59406 | nagachika | 2017-07-23 17:15:57 +0900 (Sun, 23 Jul 2017) | 12 lines

merge revision(s) 58638,58640: [Backport #11873]

	test_syntax.rb: test_brace_after_local_variable

	* test/ruby/test_syntax.rb (test_brace_after_local_variable):
	  another test using braces.  [Bug #11873]
	parse.y: do after cmdarg in paren

	* parse.y (parser_yylex): set state to ENDARG after a string
	  literal, so that `do` after a literal should be `do_block` and
	  bound to the outer method, as well as a numeric/symbol literal.
	  [ruby-core:72482] [Bug #11873]
------------------------------------------------------------------------
r59405 | nagachika | 2017-07-23 17:05:15 +0900 (Sun, 23 Jul 2017) | 9 lines

merge revision(s) 59307: [Backport #13284]

	a64: fix crash on register stack mark/sweep pass

	* thread_pthread.c: move 'register_stack_start' earlier.
	  [ruby-core:79928] [Bug #13284] [Fix GH-1625]

	Author:    Sergei Trofimovich <slyfox@gentoo.org>

------------------------------------------------------------------------
r59404 | nagachika | 2017-07-23 16:50:10 +0900 (Sun, 23 Jul 2017) | 7 lines

merge revision(s) 57530: [Backport #13191]

	sample/pty/shl.rb: update sample

	* Specify frozen_string_literal: true.
	* Fix TypeError of raise.
	* Use a character literal instead of Integer.
------------------------------------------------------------------------
r59403 | nagachika | 2017-07-23 16:48:31 +0900 (Sun, 23 Jul 2017) | 7 lines

merge revision(s) 59002: [Backport #13621]

	string.c: docs for String#split

	* string.c: [DOC] clarify docs for String#split when called
	  with limit and capture groups.
	  Reported by Cichol Tsai.  [ruby-core:81505] [Bug #13621]
------------------------------------------------------------------------
r59402 | nagachika | 2017-07-23 16:46:05 +0900 (Sun, 23 Jul 2017) | 6 lines

merge revision(s) 57446: [Backport #13413]

	mkmf.rb: fix script installation

	* lib/mkmf.rb (MakeMakefile): fix condition to install script
	  files.
------------------------------------------------------------------------
r59401 | nagachika | 2017-07-23 16:44:56 +0900 (Sun, 23 Jul 2017) | 7 lines

merge revision(s) 59161: [Backport #13672]

	parse.y: check multibyte char

	* parse.y (parser_precise_mbclen): check invalid multibyte char at
	  skipping strings following `?x` literal string, not to stuck in
	  a infinite loop.  [ruby-core:81746] [Bug #13672]
------------------------------------------------------------------------
r59400 | nagachika | 2017-07-23 16:36:10 +0900 (Sun, 23 Jul 2017) | 8 lines

merge revision(s) 59102: [Backport #13515]

	pathname.rb: UNC root pathname needs a separator

	* ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname
	  needs a separator.  File.basename returns "/" on UNC root, as
	  well as sole drive letter, even if it does not end with a
	  separator.  [ruby-core:80900] [Bug #13515]
------------------------------------------------------------------------
r59399 | nagachika | 2017-07-23 16:33:07 +0900 (Sun, 23 Jul 2017) | 9 lines

merge revision(s) 59033,59034: [Backport #13636]

	rexml: add close tag check on end of document to StreamParser

	[ruby-core:81593] [Bug #13636]

	Reported by Anton Sivakov. Thanks!!!

	* properties.
------------------------------------------------------------------------
r59398 | nagachika | 2017-07-23 16:30:43 +0900 (Sun, 23 Jul 2017) | 6 lines

merge revision(s) 58693: [Backport #13558]

	array.c: check position to insert

	* array.c (rb_ary_insert): check position to insert even if no
	  elements to be inserted.  [ruby-core:81125] [Bug #13558]
------------------------------------------------------------------------
r59397 | nagachika | 2017-07-23 16:21:04 +0900 (Sun, 23 Jul 2017) | 9 lines

merge revision(s) 58643: [Backport #13231]

	date_core.c: fix docs for %Z format

	* ext/date/date_core.c: [DOC] fix documentation for %Z format
	  of {Date,DateTime}.strftime.

	  Reported by Damon Timm.  Based on a patch by nano.
	  [ruby-core:79602] [Bug #13231] [Fix GH-1565]
------------------------------------------------------------------------
r59396 | nagachika | 2017-07-23 16:20:05 +0900 (Sun, 23 Jul 2017) | 10 lines

merge revision(s) 58552: [Backport #13531]

	rss: Accept empty text element as valid element

	Parser has been accepted it but XML serializer wasn't accepted.

	Reported by stefano frabetti. Thanks!!!

	[ruby-core:80965] [Bug #13531]

------------------------------------------------------------------------
r59395 | nagachika | 2017-07-23 16:02:29 +0900 (Sun, 23 Jul 2017) | 8 lines

merge revision(s) 59080,59082: [Backport #13656]

	proc.c: skip prepended modules

	* proc.c (method_super_method): skip prepended modules and
	  continue from the super class of the original class.
	  [ruby-core:81666] [Bug #13656]
	test/ruby/test_method.rb: refined  [ruby-core:81666] [Bug #13656]
------------------------------------------------------------------------
r59363 | nagachika | 2017-07-18 21:42:38 +0900 (Tue, 18 Jul 2017) | 9 lines

merge revision(s) 59056: [Backport #13648] [Backport #13699]

	enumerator.c: fix nested maps

	* enumerator.c (lazy_map_proc, lazy_grep_iter_proc): marks values
	  returned by blocks are not packed in the case of nested maps, so
	  that the result will be same as non-lazy version.  based on the
	  patch by akihikodaki (Akihiko Odaki) at [ruby-core:81638],
	  without GCC extension.  [Bug#13648]
------------------------------------------------------------------------
r59316 | nagachika | 2017-07-12 23:06:21 +0900 (Wed, 12 Jul 2017) | 6 lines

merge revision(s) 59312: [Backport #13739]

	optparse.rb: get rid of eval

	* lib/optparse.rb: try Float() and Integer() instead of eval,
	  which does too much things.
------------------------------------------------------------------------
r59303 | nagachika | 2017-07-10 05:46:10 +0900 (Mon, 10 Jul 2017) | 28 lines

merge revision(s) 58696: [Backport #11384]

	autoload: always wait on loading thread

	We cannot assume autoload_provided/rb_feature_provided returning
	TRUE means it is safe to proceed without waiting.  Another
	thread may call rb_provide_feature before setting the constant
	(via autoload_const_set).  So we must wait until autoload is
	completed by another thread.

	Note: this patch was tested with an explicit rb_thread_schedule
	in rb_provide_feature to make the race condition more apparent
	as suggested by <s.wanabe@gmail.com>:
	> --- a/load.c
	> +++ b/load.c
	> @@ -563,6 +563,7 @@ rb_provide_feature(VALUE feature)
	>      rb_str_freeze(feature);
	>
	>      rb_ary_push(features, rb_fstring(feature));
	> +rb_thread_schedule();
	>      features_index_add(feature, INT2FIX(RARRAY_LEN(features)-1));
	>      reset_loaded_features_snapshot();
	>  }

	* variable.c (check_autoload_required): do not assume a provided
	  feature means autoload is complete, always wait if autoload is
	  being performed by another thread.
	  [ruby-core:81105] [Bug #11384] Thanks to <s.wanabe@gmail.com>
------------------------------------------------------------------------
r59302 | nagachika | 2017-07-10 05:24:02 +0900 (Mon, 10 Jul 2017) | 13 lines

merge revision(s) 56558,59116,59136: [Backport #12670]

	* gc.c (heap_page_resurrect): do not return tomb_pages when
	  page->freelist == NULL.
	  [Bug #12670]

	test for [Bug #12670]

	heap corruption by deferred free.
	gc.c: expand sorted pages

	* gc.c (heap_page_allocate): expand sorted pages before inserting
	  allocated new page.  [Bug #12670]
------------------------------------------------------------------------
r59301 | nagachika | 2017-07-10 05:06:31 +0900 (Mon, 10 Jul 2017) | 10 lines

merge revision(s) 58825,58826: [Backport #5339]

	erb.rb: Allow explicit trimming carriage return

	when trim_mode is "-", for Windows environments.

	[ruby-core:39625] [Bug #5339]
	erb.rb: Allow trimming CR in all trim_modes

	to unify a behavior with r58823 and r58825.
------------------------------------------------------------------------
r59300 | nagachika | 2017-07-10 05:04:25 +0900 (Mon, 10 Jul 2017) | 7 lines

merge revision(s) 58823: [Backport #11464]

	erb.rb: Allow trimming carriage return

	when trim_mode is "<>", for Windows environments.

	[Bug #11464]
------------------------------------------------------------------------
r59299 | nagachika | 2017-07-10 05:02:04 +0900 (Mon, 10 Jul 2017) | 6 lines

merge revision(s) 58210: [Backport #8916]

	vsnprintf.c: prefix with precision

	* vsnprintf.c (BSD_vfprintf): sign and hex-prefix should not be
	  counted in precision.  [ruby-dev:47714] [Bug #8916]
------------------------------------------------------------------------
r59298 | nagachika | 2017-07-10 04:51:43 +0900 (Mon, 10 Jul 2017) | 5 lines

merge revision(s) 58796: [Backport #13545]

	Merge latest dtoa.c [Bug #13545]

	Apply some part of http://www.netlib.org/fp/dtoa.c with my eyes...
------------------------------------------------------------------------
r59297 | nagachika | 2017-07-10 04:49:03 +0900 (Mon, 10 Jul 2017) | 22 lines

merge revision(s) 58334,58346,58349: [Backport #13425] [Backport #13432]

	thread.c: disable VM events when stack overflow

	* thread.c (ruby_thread_stack_overflow): disable VM events when
	  stack overflow occurred; it causes another stack overflow again
	  in making backtrace object, and crashes.
	  [ruby-core:80662] [Bug #13425]
	increase timeout seconds.

	* test/ruby/test_trace.rb (test_trace_stackoverflow): on some platforms
	  this test fails because of timeout.

	disable rewind hooks.

	* vm.c (hook_before_rewind): skip rewind hooks if err is SystemStackError
	  because rewind hooks can cause stack overflow again and again.

	* thread.c (ruby_thread_stack_overflow): do not disable all hooks.
	  Additionally, clearing ruby_vm_event_flags is not suitable way
	  to disable hooks.

------------------------------------------------------------------------
r59296 | nagachika | 2017-07-10 04:47:28 +0900 (Mon, 10 Jul 2017) | 18 lines

merge revision(s) 58262,5826: [Backport #13369]

	fix TracePoint#return_value with non-local exits

	* vm.c: get return_value from imemo_throw_data object (THROW_DATA_VAL()).
	  imemo_throw_data (TAG_BREAK) contains returned value.
	  However, imemo_throw_data (TAG_BREAK) can skip several frames so that
	  we need to use it only once (at most internal frame). To record it,
	  we introduced THROW_DATA_CONSUMED and check it.

	* internal.h: define THROW_DATA_CONSUMED flag.

	* test/ruby/test_settracefunc.rb: add tests for [Bug #13369]

	* vm_insnhelper.h: add THROW_DATA_CONSUMED_P() and
	  THROW_DATA_CONSUMED_SET().
	  unless File::FNM_DOTMATCH is set. (like '*/') [ruby-dev:23014]

------------------------------------------------------------------------
r59295 | nagachika | 2017-07-10 04:36:49 +0900 (Mon, 10 Jul 2017) | 13 lines

merge revision(s) 59030,59031: [Backport #13638]

	thread.c: avoid busy looping on rb_thread_fd_close

	We no longer use it this function, but extensions do, and
	we need to ensure it continues to work for them.

	* thread.c (rb_thread_fd_close): schedule other threads in loop
	* ext/-test-/thread_fd_close/thread_fd_close.c: new file
	* ext/-test-/thread_fd_close/depend: ditto
	* ext/-test-/thread_fd_close/extconf.rb: ditto
	* test/-ext-/thread_fd_close/test_thread_fd_close.rb: new test
	* properties.
------------------------------------------------------------------------
r59294 | nagachika | 2017-07-10 04:27:57 +0900 (Mon, 10 Jul 2017) | 6 lines

merge revision(s) 57248: [Backport #13573]

	 dir.c: getattrlist on OSX 10.5

	* dir.c (is_case_sensitive): use getattrlist() if fgetattrlist()
	  is unavailable, on OSX 10.5.  [ruby-core:68829] [Bug #11054]
------------------------------------------------------------------------
r59293 | nagachika | 2017-07-10 04:02:35 +0900 (Mon, 10 Jul 2017) | 7 lines

merge revision(s) 58658: [Backport #13554]

	process.c: temporary string for buffer

	* process.c (obj2uid, obj2gid): use temporary string as the buffer
	  instead of `rb_alloc_tmp_buffer`, which is `NODE_ALLOCA` since
	  r51492.  [ruby-core:81084] [Bug #13554]
------------------------------------------------------------------------
r59286 | nagachika | 2017-07-08 11:21:36 +0900 (Sat, 08 Jul 2017) | 55 lines

merge revision(s) 58284,58812,59028: [Backport #13632]

	vm_core.h: ruby_error_stream_closed

	* vm_core.h (ruby_special_exceptions): renamed
	  ruby_error_closed_stream as ruby_error_stream_closed, like the
	  message.
	speed up IO#close with many threads

	Today, it increases IO#close performance with many threads:

	  Execution time (sec)
	  name            trunk   after
	  vm_thread_close 4.276   3.018

	  Speedup ratio: compare with the result of `trunk' (greater is better)
	  name            after
	  vm_thread_close 1.417

	This speedup comes because rb_notify_fd_close only scans threads
	inside rb_thread_io_blocking_region, not all threads in the VM.

	In the future, this type data structure may allow us to notify
	waiters of multiple FDs on a single thread (when using
	Fibers).

	* thread.c (struct waiting_fd): declare
	  (rb_thread_io_blocking_region): use on-stack list waiter
	  (rb_notify_fd_close): walk vm->waiting_fds instead
	  (call_without_gvl): remove old field setting
	  (th_init): ditto
	* vm_core.h (typedef struct rb_vm_struct): add waiting_fds list
	* (typedef struct rb_thread_struct): remove waiting_fd field
	  (rb_vm_living_threads_init): initialize waiting_fds list

	I am now kicking myself for not thinking about this 3 years ago
	when I introduced ccan/list in [Feature #9632] to optimize this
	same function :<
	IO#close: do not enqueue redundant interrupts (take #2)

	Enqueuing multiple errors for one event causes spurious errors
	down the line, as reported by Nikolay Vashchenko in
	https://bugs.ruby-lang.org/issues/13632

	This should fix bad interactions with test_race_gets_and_close
	in test/ruby/test_io.rb since we ensure rb_notify_fd_close
	continues returning the busy flag after enqueuing the interrupt.

	Backporting changes to 2.4 and earlier releases will be more
	challenging...

	* thread.c (rb_notify_fd_close): do not enqueue multiple interrupts
	  [ruby-core:81581] [Bug #13632]
	* test/ruby/test_io.rb (test_single_exception_on_close):
	  new test based on script from Nikolay
------------------------------------------------------------------------
r59247 | nagachika | 2017-07-01 20:51:13 +0900 (Sat, 01 Jul 2017) | 13 lines

merge revision(s) 58545,58584: [Backport #13536]

	ripper/lexer.rb: nested indented heredoc

	* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): fix for
	  nested indedented here documents, where `Elem`s are nested too.
	  [ruby-core:80977] [Bug #13536]
	ripper/lexer.rb: nested indented heredoc

	* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): insert
	  stripped leading spaces as `on_ignored_sp` elements, so that the
	  original source can be reconsructed.
	  [ruby-core:80977] [Bug #13536]
------------------------------------------------------------------------
r58637 | nagachika | 2017-05-10 00:42:52 +0900 (Wed, 10 May 2017) | 13 lines

merge revision(s) 58587,58588: [Backport #13526]

	variable.c: cleanup waitq upon thread death

	* variable.c (autoload_reset): use idempotent list_del_init
	  (autoload_sleep): moved code from rb_autoload_load
	  (autoload_sleep_done): cleanup for use with rb_ensure
	  (rb_autoload_load): ensure list delete happens in case the
	  thread dies during sleep
	* test/ruby/bug-13526.rb: new script for separate execution
	* test/ruby/test_autoload.rb (test_bug_13526): new test
	  [ruby-core:81016] [Bug #13526]
	* properties.
------------------------------------------------------------------------
r58636 | nagachika | 2017-05-10 00:30:19 +0900 (Wed, 10 May 2017) | 11 lines

merge revision(s) 58359: [Backport #13439]

	fix RSTRUCT_LEN macro in public C API

	rb_struct_size returns an Integer VALUE, so it must be converted
