ruby-changes:31335
From: nagachika <ko1@a...>
Date: Thu, 24 Oct 2013 22:46:15 +0900 (JST)
Subject: [ruby-changes:31335] nagachika:r43414 (ruby_2_0_0): merge revision(s) 43376: [Backport #9038]
nagachika 2013-10-24 22:46:04 +0900 (Thu, 24 Oct 2013) New Revision: 43414 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43414 Log: merge revision(s) 43376: [Backport #9038] * encoding.c (load_encoding): should preserve outer errinfo, so that expected exception may not be lost. [ruby-core:57949] [Bug #9038] Modified directories: branches/ruby_2_0_0/ Modified files: branches/ruby_2_0_0/ChangeLog branches/ruby_2_0_0/encoding.c branches/ruby_2_0_0/test/ruby/test_encoding.rb branches/ruby_2_0_0/version.h Index: ruby_2_0_0/encoding.c =================================================================== --- ruby_2_0_0/encoding.c (revision 43413) +++ ruby_2_0_0/encoding.c (revision 43414) @@ -582,6 +582,7 @@ load_encoding(const char *name) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/encoding.c#L582 VALUE enclib = rb_sprintf("enc/%s.so", name); VALUE verbose = ruby_verbose; VALUE debug = ruby_debug; + VALUE errinfo; VALUE loaded; char *s = RSTRING_PTR(enclib) + 4, *e = RSTRING_END(enclib) - 3; int idx; @@ -595,10 +596,11 @@ load_encoding(const char *name) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/encoding.c#L596 OBJ_FREEZE(enclib); ruby_verbose = Qfalse; ruby_debug = Qfalse; + errinfo = rb_errinfo(); loaded = rb_protect(require_enc, enclib, 0); ruby_verbose = verbose; ruby_debug = debug; - rb_set_errinfo(Qnil); + rb_set_errinfo(errinfo); if (NIL_P(loaded)) return -1; if ((idx = rb_enc_registered(name)) < 0) return -1; if (enc_autoload_p(enc_table.list[idx].enc)) return -1; Index: ruby_2_0_0/ChangeLog =================================================================== --- ruby_2_0_0/ChangeLog (revision 43413) +++ ruby_2_0_0/ChangeLog (revision 43414) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1 +Thu Oct 24 22:36:56 2013 Nobuyoshi Nakada <nobu@r...> + + * encoding.c (load_encoding): should preserve outer errinfo, so that + expected exception may not be lost. [ruby-core:57949] [Bug #9038] + Fri Oct 18 02:10:00 2013 Shugo Maeda <shugo@r...> * vm_insnhelper.c (vm_call_method): set ci->me to 0 when the Index: ruby_2_0_0/version.h =================================================================== --- ruby_2_0_0/version.h (revision 43413) +++ ruby_2_0_0/version.h (revision 43414) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1 #define RUBY_VERSION "2.0.0" -#define RUBY_RELEASE_DATE "2013-10-18" -#define RUBY_PATCHLEVEL 337 +#define RUBY_RELEASE_DATE "2013-10-24" +#define RUBY_PATCHLEVEL 338 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 10 -#define RUBY_RELEASE_DAY 18 +#define RUBY_RELEASE_DAY 24 #include "ruby/version.h" Index: ruby_2_0_0/test/ruby/test_encoding.rb =================================================================== --- ruby_2_0_0/test/ruby/test_encoding.rb (revision 43413) +++ ruby_2_0_0/test/ruby/test_encoding.rb (revision 43414) @@ -113,4 +113,12 @@ class TestEncoding < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_encoding.rb#L113 asc = "b".force_encoding(Encoding::US_ASCII) assert_equal(Encoding::ASCII_8BIT, Encoding.compatible?(bin, asc)) end + + def test_errinfo_after_autoload + bug9038 = '[ruby-core:57949] [Bug #9038]' + assert_separately(%w[--disable=gems], <<-"end;") + e = assert_raise(SyntaxError) { eval("/regexp/sQ") } + assert_match(/unknown regexp option - Q/, e.message, #{bug9038.dump}) + end; + end end Property changes on: ruby_2_0_0 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r43376 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/