ruby-changes:40661
From: nagachika <ko1@a...>
Date: Wed, 25 Nov 2015 00:42:46 +0900 (JST)
Subject: [ruby-changes:40661] nagachika:r52740 (ruby_2_2): merge revision(s) 51816: [Backport #8543]
nagachika 2015-11-25 00:42:30 +0900 (Wed, 25 Nov 2015) New Revision: 52740 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52740 Log: merge revision(s) 51816: [Backport #8543] * compile.c (iseq_build_from_ary_body): register cdhash to the iseq constant body instead of compile time mark array, not to get GCed. [ruby-core:70708] [Feature #8543] Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/compile.c branches/ruby_2_2/test/ruby/test_iseq.rb branches/ruby_2_2/version.h Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 52739) +++ ruby_2_2/ChangeLog (revision 52740) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Wed Nov 25 00:32:44 2015 Nobuyoshi Nakada <nobu@r...> + + * compile.c (iseq_build_from_ary_body): register cdhash to the + iseq constant body instead of compile time mark array, not to + get GCed. [ruby-core:70708] [Feature #8543] + Wed Nov 25 00:14:28 2015 NARUSE, Yui <naruse@r...> * ext/digest/*/*.[ch]: include ruby.h before digest.h to avoid Index: ruby_2_2/compile.c =================================================================== --- ruby_2_2/compile.c (revision 52739) +++ ruby_2_2/compile.c (revision 52740) @@ -5973,7 +5973,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq https://github.com/ruby/ruby/blob/trunk/ruby_2_2/compile.c#L5973 } RB_GC_GUARD(op); argv[j] = map; - iseq_add_mark_object_compile_time(iseq, map); + rb_iseq_add_mark_object(iseq, map); } break; case TS_FUNCPTR: Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 52739) +++ ruby_2_2/version.h (revision 52740) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.4" #define RUBY_RELEASE_DATE "2015-11-25" -#define RUBY_PATCHLEVEL 196 +#define RUBY_PATCHLEVEL 197 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 11 Index: ruby_2_2/test/ruby/test_iseq.rb =================================================================== --- ruby_2_2/test/ruby/test_iseq.rb (revision 52739) +++ ruby_2_2/test/ruby/test_iseq.rb (revision 52740) @@ -51,6 +51,26 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_iseq.rb#L51 assert_raise_with_message(TypeError, /:foobar/) {RubyVM::InstructionSequence.load(ary)} end if defined?(RubyVM::InstructionSequence.load) + def test_loaded_cdhash_mark + iseq = RubyVM::InstructionSequence.compile(<<-'end;', __FILE__, __FILE__, __LINE__+1) + def bug(kw) + case kw + when "false" then false + when "true" then true + when "nil" then nil + else raise("unhandled argument: #{kw.inspect}") + end + end + end; + assert_separately([], <<-"end;") + iseq = #{iseq.to_a.inspect} + RubyVM::InstructionSequence.load(iseq).eval + assert_equal(false, bug("false")) + GC.start + assert_equal(false, bug("false")) + end; + end if defined?(RubyVM::InstructionSequence.load) + def test_disasm_encoding src = "\u{3042} = 1; \u{3042}; \u{3043}" asm = RubyVM::InstructionSequence.compile(src).disasm Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r51816 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/