From a486583503f13062072b261a03f82791d5c52cd0 Mon Sep 17 00:00:00 2001 From: yugui Date: Sun, 25 Oct 2009 14:45:54 +0000 Subject: merges r25411 from trunk into ruby_1_9_1. -- * marshal.c (w_symbol, r_symreal): fixed the order of symbol and its encoding modifier, in order to make the dump readable from 1.8. [ruby-dev:39515] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@25475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ marshal.c | 6 ++++-- version.h | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29f7beeab..ed8c1ccfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Oct 20 17:57:31 2009 Nobuyoshi Nakada + + * marshal.c (w_symbol, r_symreal): fixed the order of symbol and + its encoding modifier, in order to make the dump readable from + 1.8. [ruby-dev:39515] + Mon Aug 10 21:45:26 2009 Nobuyoshi Nakada * include/ruby/intern.h (rb_path2class): no deprecation. diff --git a/marshal.c b/marshal.c index aa0e7e8d0..f9f6bb634 100644 --- a/marshal.c +++ b/marshal.c @@ -412,13 +412,13 @@ w_symbol(ID id, struct dump_arg *arg) } w_byte(TYPE_SYMBOL, arg); w_bytes(RSTRING_PTR(sym), RSTRING_LEN(sym), arg); + st_add_direct(arg->symbols, id, arg->symbols->num_entries); if (encidx != -1) { struct dump_call_arg c_arg; c_arg.limit = 1; c_arg.arg = arg; w_encoding(sym, 0, &c_arg); } - st_add_direct(arg->symbols, id, arg->symbols->num_entries); } } @@ -1095,7 +1095,9 @@ r_symreal(struct load_arg *arg, int ivar) volatile VALUE s = r_bytes(arg); ID id; int idx = -1; + st_index_t n = arg->symbols->num_entries; + st_insert(arg->symbols, (st_data_t)n, (st_data_t)0); if (ivar) { long num = r_long(arg); while (num-- > 0) { @@ -1106,7 +1108,7 @@ r_symreal(struct load_arg *arg, int ivar) if (idx < 0) idx = rb_usascii_encindex(); rb_enc_associate_index(s, idx); id = rb_intern_str(s); - st_insert(arg->symbols, arg->symbols->num_entries, id); + st_insert(arg->symbols, (st_data_t)n, (st_data_t)id); return id; } diff --git a/version.h b/version.h index 62a44d312..13693313d 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 284 +#define RUBY_PATCHLEVEL 285 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -- cgit