diff --git a/test/ruby/test_backtrace.rb b/test/ruby/test_backtrace.rb index 6ec13e4cc5..ed36fe95f6 100644 --- a/test/ruby/test_backtrace.rb +++ b/test/ruby/test_backtrace.rb @@ -214,4 +214,31 @@ class TestBacktrace < Test::Unit::TestCase q << true end end + + def test_core_backtrace_alias + obj = BasicObject.new + e = assert_raise(NameError) do + class << obj + alias foo bar + end + end + assert_not_match(/\Acore#/, e.backtrace_locations[0].base_label) + end + + def test_core_backtrace_undef + obj = BasicObject.new + e = assert_raise(NameError) do + class << obj + undef foo + end + end + assert_not_match(/\Acore#/, e.backtrace_locations[0].base_label) + end + + def test_core_backtrace_hash_merge + e = assert_raise(TypeError) do + {**nil} + end + assert_not_match(/\Acore#/, e.backtrace_locations[0].base_label) + end end diff --git a/version.h b/version.h index fa85fbe3b2..cc54704b1b 100644 --- a/version.h +++ b/version.h @@ -1,10 +1,10 @@ #define RUBY_VERSION "2.1.2" -#define RUBY_RELEASE_DATE "2014-06-30" -#define RUBY_PATCHLEVEL 157 +#define RUBY_RELEASE_DATE "2014-07-01" +#define RUBY_PATCHLEVEL 158 #define RUBY_RELEASE_YEAR 2014 -#define RUBY_RELEASE_MONTH 6 -#define RUBY_RELEASE_DAY 30 +#define RUBY_RELEASE_MONTH 7 +#define RUBY_RELEASE_DAY 1 #include "ruby/version.h" diff --git a/vm.c b/vm.c index f74d4c485d..e8e2257e67 100644 --- a/vm.c +++ b/vm.c @@ -2262,46 +2262,62 @@ m_core_set_postexe(VALUE self) return Qnil; } +static VALUE core_hash_merge_ary(VALUE hash, VALUE ary); +static VALUE core_hash_from_ary(VALUE ary); +static VALUE core_hash_merge_kwd(int argc, VALUE *argv); + +static VALUE +core_hash_merge(VALUE hash, long argc, const VALUE *argv) +{ + long i; + + assert(argc % 2 == 0); + for (i=0; i