merge revision(s) 42724: [Backport #8238]

	* vm_insnhelper.c (vm_call_method): a method entry refers the based
	  class/module, so should search superclass from the origin i-class
	  where the entry belongs to, to get rid of infinite loop when zsuper
	  in a prepended class/module.  [ruby-core:54105] [Bug #8238]


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

	* ext/zlib/zlib.c (zstream_run):  Fix handling of deflate streams that
	  need a dictionary but are being decompressed by Zlib::Inflate.inflate
	  (which has no option to set a dictionary).  Now Zlib::NeedDict is
	  raised instead of crashing.  [ruby-trunk - Bug #8829]

	* test/zlib/test_zlib.rb (TestZlibInflate):  Test for the above.


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

	* variable.c (classname): the name of class that has
	  non class id should not be nil. This bug was introduced
	  in r36577.

	* test/thread/test_cv.rb: test for change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 42596,42597,42598,42599: [Backport #8795]

	* time.c (time_mload): ignore invalid offset and zone.
	  [ruby-core:56648] [Bug #8795]

	* time.c (time_mload): ignore auxiliary data, offset and zone, if
	  invalid.  [ruby-core:56648] [Bug #8795]

	* test/ruby/test_time.rb: use the in_timezone() helper
	  and define it at the top with other helpers.


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

	* configure.in (sys/pstat.h): fix missing header check for
	  missing/setproctitle.c on HP-UX.  [ruby-core:56644] [Bug #8792]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 40021,42380: [Backport #8686]

	test_method.rb: split

	* test/ruby/test_method.rb (test_define_method): split for each tests.
	* object.c (rb_class_inherited_p): allow iclasses to be tested for
	  inheritance. [Bug #8686] [ruby-core:56174]

	* test/ruby/test_method.rb: add test


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

	* string.c (str_gsub): use BEG(0) for whole matched position not
	  return value from rb_reg_search(), for \K matching.
	  [ruby-dev:47694] [Bug #8856]


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

	* enumerator.c (lazy_zip_func): fix non-single argument.  fix
	  out-of-bound access and pack multiple yielded values.
	  [ruby-core:56383] [Bug #8735]


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

	* vm_eval.c (vm_call0): fix prototype, the id parameter should be of
	  type ID, not VALUE

	* vm_insnhelper.c (check_match): the rb_funcall family of functions
	  does not care about refinements. We need to use
	  rb_method_entry_with_refinements instead to call === with
	  refinements. Thanks to Jon Conley for reporting this bug.
	  [ruby-core:57051] [Bug #8872]

	* test/ruby/test_refinement.rb: add test


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

	* class.c (method_entry_i): should exclude refined methods from
	  instance method list.  [ruby-core:57080] [Bug #8881]


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

	* vm_backtrace.c (vm_backtrace_to_ary): Ignore the second argument if
	  it is nil. [Bug #8884] [ruby-core:57094]

	* test/ruby/test_backtrace.rb (test_caller_with_nil_length):
	  Test for above.


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

	* thread.c (rb_mutex_unlock): Mutex#unlock no longer raise
	  an exception even if uses on trap. [Bug #8891]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 42782,42799: [Backport #8902]

	* vm_insnhelper.c (vm_search_super_method): use ci->argc instead of
	  ci->orig_argc. ci->argc can be changed by splat arguments.
	  [ruby-list:49575]
	  This fix should be applied to Ruby 2.0.0 seriese.

	* test/ruby/test_super.rb: add a test for above.

	* numeric.c (NUM_STEP_SCAN_ARGS): On second thought, keep

	* internal.h (bit_length): Add casts to fix compilation error with
	  This fix should be applied to Ruby 2.0.0 series.
	  numeric literal, for the backward compatibility.


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

	* enumerator.c: [DOC] Remove reference to Enumerator::Lazy#cycle
	  Patch by @kachick [Fixes GH-372]
	  https://github.com/ruby/ruby/pull/372


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

	* object.c (Init_Object): undef Module#prepend_features on Class, as
	  well as Module#append_features.  [Fixes GH-376]

	* test_class.rb: Added test for above. And ensure type checking
	  on similar methods as module_function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/rubygems: Update to RubyGems to 2.0.8. [ruby-core:57155]
  [Backport #8900]
  the patch is provided by drbrain (Eric Hodel).
  this update contains a security fix for CVE-2013-4287.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 42908,42918: [Backport #8864]

	test_sprintf_comb.rb: split tests

	* test/ruby/test_sprintf_comb.rb (test_format_integer),
  (test_format_float): split huge tests by the formats.
	* vsnprintf.c (MAXEXP, MAXFRACT): calculate depending on constants in
	  float.h.

	* vsnprintf.c (BSD_vfprintf): limit length for cvt() to get rid of
	  buffer overflow.  [ruby-core:57023] [Bug #8864]

	* vsnprintf.c (exponent): make expbuf size more precise.


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

	* hash.c (rb_hash_aset): [DOC] Document key dup patch by @kachick
	  [Fixes GH-382] https://github.com/ruby/ruby/pull/382


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

	* tool/rbinstall.rb (Gem::Specification#initialize): default date to
	  RUBY_RELEASE_DATE.  [ruby-core:57072] [Bug #8878]

	* tool/rbinstall.rb (Gem::Specification#to_ruby): add date.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/rubygems: Update to Rubygems 2.0.9. [ruby-core:57183]
  [Backport #8908]
  the patch is provided by drbrain (Eric Hodel).


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