* marshal.c (w_symbol): dump no encoding for 7bit only coderange

symbol.  [ruby-core:27375]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-01-08 04:12:29 +00:00
Родитель 59a56629b5
Коммит 902b109465
4 изменённых файлов: 13 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Fri Jan 8 13:12:26 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* marshal.c (w_symbol): dump no encoding for 7bit only coderange
symbol. [ruby-core:27375]
Thu Jan 7 07:56:09 2010 Ryan Davis <ryand-ruby@zenspider.com> Thu Jan 7 07:56:09 2010 Ryan Davis <ryand-ruby@zenspider.com>
* lib/minitest/*.rb: Imported minitest 1.5.0 r5596. * lib/minitest/*.rb: Imported minitest 1.5.0 r5596.

Просмотреть файл

@ -424,10 +424,11 @@ w_symbol(ID id, struct dump_arg *arg)
rb_raise(rb_eTypeError, "can't dump anonymous ID %ld", id); rb_raise(rb_eTypeError, "can't dump anonymous ID %ld", id);
} }
encidx = rb_enc_get_index(sym); encidx = rb_enc_get_index(sym);
if (encidx == rb_usascii_encindex()) { if (encidx == rb_usascii_encindex() ||
rb_enc_str_coderange(sym) == ENC_CODERANGE_7BIT) {
encidx = -1; encidx = -1;
} }
else if (rb_enc_str_coderange(sym) != ENC_CODERANGE_7BIT) { else {
w_byte(TYPE_IVAR, arg); w_byte(TYPE_IVAR, arg);
} }
w_byte(TYPE_SYMBOL, arg); w_byte(TYPE_SYMBOL, arg);

Просмотреть файл

@ -261,6 +261,9 @@ class TestMarshal < Test::Unit::TestCase
[:ruby, :"\u{7d05}\u{7389}"].each do |sym| [:ruby, :"\u{7d05}\u{7389}"].each do |sym|
assert_equal(sym, Marshal.load(Marshal.dump(sym)), '[ruby-core:24788]') assert_equal(sym, Marshal.load(Marshal.dump(sym)), '[ruby-core:24788]')
end end
bug2548 = '[ruby-core:27375]'
ary = [:$1, nil]
assert_equal(ary, Marshal.load(Marshal.dump(ary)), bug2548)
end end
ClassUTF8 = eval("class R\u{e9}sum\u{e9}; self; end") ClassUTF8 = eval("class R\u{e9}sum\u{e9}; self; end")

Просмотреть файл

@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2" #define RUBY_VERSION "1.9.2"
#define RUBY_RELEASE_DATE "2010-01-07" #define RUBY_RELEASE_DATE "2010-01-08"
#define RUBY_PATCHLEVEL -1 #define RUBY_PATCHLEVEL -1
#define RUBY_BRANCH_NAME "trunk" #define RUBY_BRANCH_NAME "trunk"
@ -8,7 +8,7 @@
#define RUBY_VERSION_TEENY 1 #define RUBY_VERSION_TEENY 1
#define RUBY_RELEASE_YEAR 2010 #define RUBY_RELEASE_YEAR 2010
#define RUBY_RELEASE_MONTH 1 #define RUBY_RELEASE_MONTH 1
#define RUBY_RELEASE_DAY 7 #define RUBY_RELEASE_DAY 8
#include "ruby/version.h" #include "ruby/version.h"