summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 14:45:54 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 14:45:54 +0000
commit0cfb043b45aca903a6a42002faa91e106ad8247d (patch)
tree2f06fa340416cb387ba86a437ac3a61d9c9f7dea
parentd50e1bdcd766e8aa8b84133fe510e71a11ac6b10 (diff)
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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@25475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--marshal.c6
-rw-r--r--version.h2
3 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 29f7beeaba..ed8c1ccfc5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Oct 20 17:57:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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 <nobu@ruby-lang.org>
* include/ruby/intern.h (rb_path2class): no deprecation.
diff --git a/marshal.c b/marshal.c
index aa0e7e8d04..f9f6bb634e 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 62a44d312b..13693313dd 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