Skip to content

Commit a5200c5

Browse files
committed
merges r22395 and r22640 from trunk into ruby_1_9_1.
-- * array.c (rb_ary_resurrect), string.c (rb_str_resurrect): new functions based on [ruby-dev:37983] * insns.def (putstring, duparray): use rb_{ary,str}_resurrect(). * iseq.c (iseq_data_to_ary): needs to result TS_VALUE. -- * iseq.c (cdhash_each): resurrects internal literals. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 9eb12e0 commit a5200c5

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
Thu Feb 26 13:23:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
2+
3+
* iseq.c (cdhash_each): resurrects internal literals.
4+
5+
Wed Feb 18 14:33:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
6+
7+
* array.c (rb_ary_resurrect), string.c (rb_str_resurrect): new
8+
functions based on [ruby-dev:37983]
9+
10+
* insns.def (putstring, duparray): use rb_{ary,str}_resurrect().
11+
12+
* iseq.c (iseq_data_to_ary): needs to result TS_VALUE.
13+
114
Wed Dec 9 09:50:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
215

316
* string.c (rb_str_justify): fixed the case a fill size is a

iseq.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ VALUE rb_cISeq;
2323

2424
#define hidden_obj_p(obj) (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass)
2525

26+
static inline VALUE
27+
obj_resurrect(VALUE obj)
28+
{
29+
if (hidden_obj_p(obj)) {
30+
switch (BUILTIN_TYPE(obj)) {
31+
case T_STRING:
32+
obj = rb_str_replace(rb_str_new(0, 0), obj);
33+
break;
34+
case T_ARRAY:
35+
obj = rb_ary_new4(RARRAY_LEN(obj), RARRAY_PTR(obj));
36+
break;
37+
}
38+
}
39+
return obj;
40+
}
41+
2642
static void
2743
compile_data_free(struct iseq_compile_data *compile_data)
2844
{
@@ -714,6 +730,7 @@ insn_operand_intern(rb_iseq_t *iseq,
714730
break;
715731
}
716732
}
733+
op = obj_resurrect(op);
717734
ret = rb_inspect(op);
718735
if (CLASS_OF(op) == rb_cISeq) {
719736
rb_ary_push(child, op);
@@ -1015,7 +1032,7 @@ exception_type2symbol(VALUE type)
10151032
static int
10161033
cdhash_each(VALUE key, VALUE value, VALUE ary)
10171034
{
1018-
rb_ary_push(ary, key);
1035+
rb_ary_push(ary, obj_resurrect(key));
10191036
rb_ary_push(ary, value);
10201037
return ST_CONTINUE;
10211038
}
@@ -1145,7 +1162,7 @@ iseq_data_to_ary(rb_iseq_t *iseq)
11451162
rb_ary_push(ary, INT2FIX(*seq));
11461163
break;
11471164
case TS_VALUE:
1148-
rb_ary_push(ary, *seq);
1165+
rb_ary_push(ary, obj_resurrect(*seq));
11491166
break;
11501167
case TS_ISEQ:
11511168
{

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define RUBY_VERSION "1.9.1"
2-
#define RUBY_PATCHLEVEL 419
2+
#define RUBY_PATCHLEVEL 420
33
#define RUBY_VERSION_MAJOR 1
44
#define RUBY_VERSION_MINOR 9
55
#define RUBY_VERSION_TEENY 1

0 commit comments

Comments
 (0)