merge revision(s) 39388: [Backport #9368]

	* lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
	  fix a typo in comment in r39384.


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39276: [Backport #7825]

	* vm.c (rb_thread_mark): mark a working Proc of bmethod
	  (a method defined by define_method) even if the method was removed.
	  We could not trace working Proc object which represents the body
	  of bmethod if the method was removed (alias/undef/overridden).
	  Simply, it was mark miss.
	  This patch by Kazuki Tsujimoto. [Bug #7825]
	  NOTE: We can brush up this marking because we do not need to mark
	  `me' on each living control frame. We need to mark `me's
	  only if `me' was free'ed. This is future work after Ruby 2.0.0.

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


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 44449: [Backport #9308]

	* parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to
	  isolate command argument state from outer scope.
	  [ruby-core:59342] [Bug #9308]


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 44195: [Backport #7772]

	* util.c (ruby_qsort): fix potential stack overflow on a large
	  machine.  based on the patch by Conrad Irwin <conrad.irwin AT
	  gmail.com> at [ruby-core:51816].  [Bug #7772]


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 44312,44318,44321: [Backport #9273]

	* lib/resolv.rb (Resolv::Hosts#lazy_initialize): should not
	  consider encodings in hosts file.  [ruby-core:59239] [Bug #9273]

	* lib/resolv.rb (Resolv::Config.parse_resolv_conf): ditto.


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 43685,43690,43705: [Backport #9110]

	* eval_jump.c (rb_exec_end_proc): fix double free or corruption error
	  when reentering by callcc. [ruby-core:58329] [Bug #9110]

	* test/ruby/test_beginendblock.rb: test for above.

	* eval_jump.c (rb_exec_end_proc): unlink and free procs data before
	  calling for each procs.  [Bug #9110]


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 43954: [Backport #9125]

	* lib/net/smtp.rb (Net::SMTP#critical):  Always return a
	  Net::SMTP::Response.  Patch by Pawel Veselov.
	  [ruby-trunk - Bug #9125]

	* test/net/smtp/test_smtp.rb:  Test for the above.


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 43208: [Backport #9003]

	* compar.c (cmp_eq): fail if recursion.  [ruby-core:57736] [Bug #9003]

	* thread.c (rb_exec_recursive_paired_outer): new function which is
	  combinnation of paired and outer variants.


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 43398,43407,43408,43417: [Backport #9044]

	* win32/Makefile.sub (config.h): VC 2013 supports C99 mathematics
	  functions.  [ruby-core:57981] [Bug #9044]

	* include/ruby/win32.h (rb_infinity_float): suppress overflow in
	  constant arithmetic warnings.  [ruby-core:57981] [Bug #9044]


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39594,39596: [Backport #8010]

	* enumerator.c (enumerator_with_index_i): allow Bignum as offset, to
	  get rid of conversion exception and integer overflow.
	  [ruby-dev:47131] [Bug #8010]

	* enumerator.c (enumerator_with_index):  Restore handling of a nil memo
	  from r39594.


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39722,43929: [Backport #9178]

	* enumerator.c (enumerator_with_index): try to convert given offset to
	  integer. fix bug introduced in r39594.

	* enumerator.c (enumerator_with_index): should not store local variable
	  address to memoise the arguments.  it is invalidated after the return.
	  [ruby-core:58692] [Bug #9178]


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 44086,44126: [Backport #9221]

	* ext/date/date_parse.c (parse_time): unset case-insensitive flag
	  for [:alpha:], which already implies both cases, to get rid of
	  backtrack explosion.  [ruby-core:58876] [Bug #9221]

	* ext/date/date_strptime.c (date__strptime_internal): unset
	  case-insensitive flag for [:alpha:], which already implies both
	  cases, to get rid of backtrack explosion.  [ruby-core:58984]
	  [Bug #9221]


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enumerator.c (enumerator_with_index_i): add the declaration of
  rb_int_succ().  this fixes test failure on OS X introduced at r44745.


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enumerator.c: include internal.h instead of declaring the external
  function there.


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 44570:44572,44581:

	r44570 | nobu | 2014-01-12 17:11:32 +0900 (Sun, 12 Jan 2014) | 4 lines

	tcltklib.c: create_ip_exc format argument

	* ext/tk/tcltklib.c (create_ip_exc): format argument must not be a
  dynamic string, not to contain unescaped %.
	------------------------------------------------------------------------
	r44571 | nobu | 2014-01-12 17:11:34 +0900 (Sun, 12 Jan 2014) | 5 lines

	stubs.c: library name strings

	* ext/tk/stubs.c (ruby_open_tcl_dll, ruby_open_tk_dll): make library
  names by string literal concatenation at compilation time, not by
  sprintf() at runtime.
	------------------------------------------------------------------------
	r44572 | nobu | 2014-01-12 17:11:36 +0900 (Sun, 12 Jan 2014) | 1 line

	ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUE
	* ext/bigdecimal/bigdecimal.c (CLASS_NAME): macro to wrap
	  depending on PRIsVALUE for 1.9.  [Backport #9406]

	* ext/bigdecimal/bigdecimal.c (DECIMAL_SIZE_OF_BITS): fallback
	  definition for 2.1 or older.  [ruby-core:59750] [Backport #9406]


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1.9.3 does not have rb_exc_new_str().  use rb_exc_new3() instead of it.
this fixes the test failures introduced by previous commit.


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 33361,33460: [Backport #9463]

	* gc.c (slot_sweep, rb_gc_finalize_deferred)
	  (rb_objspace_call_finalizer, rb_gc): run finalizers
	  sequencially.  [ruby-dev:44562]

	* gc.c (rb_gc_finalize_deferred, rb_objspace_call_finalizer):
	  should use ATOMIC_EXCHANGE() to check the previous value.
	  [ruby-dev:44596] [Bug #5439]


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 43994,44000: [Backport #9205]

	* gc.c (finalize_deferred): flush all deferred finalizers while other
	  finalizers can get ready to run newly by lazy sweep.
	  [ruby-core:58833] [Bug #9205]


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h (ATOMIC_PTR_EXCHANGE): fixed previous commit.


git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_1_9_3@44765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 40534,41886,41903,41910: [Backport #8616]

	process.c: rb_daemon should not raise

	* process.c (rb_daemon): should not raise exceptions, since
  proc_daemon() will deal with errors.
	* process.c (fork_daemon): kill the other threads all and abandon the
	  kept mutexes.

	* process.c (fork_daemon): kill the other threads all and abandon the
	  kept mutexes.

	* process.c (rb_daemon): daemon(3) is implemented with fork(2).
	  Therefore it needs rb_thread_atfork(). (and revert r41903)


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