File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change
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
+
1
14
Wed Dec 9 09:50:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
2
15
3
16
* string.c (rb_str_justify): fixed the case a fill size is a
Original file line number Diff line number Diff line change @@ -23,6 +23,22 @@ VALUE rb_cISeq;
23
23
24
24
#define hidden_obj_p (obj ) (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass)
25
25
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
+
26
42
static void
27
43
compile_data_free (struct iseq_compile_data * compile_data )
28
44
{
@@ -714,6 +730,7 @@ insn_operand_intern(rb_iseq_t *iseq,
714
730
break ;
715
731
}
716
732
}
733
+ op = obj_resurrect (op );
717
734
ret = rb_inspect (op );
718
735
if (CLASS_OF (op ) == rb_cISeq ) {
719
736
rb_ary_push (child , op );
@@ -1015,7 +1032,7 @@ exception_type2symbol(VALUE type)
1015
1032
static int
1016
1033
cdhash_each (VALUE key , VALUE value , VALUE ary )
1017
1034
{
1018
- rb_ary_push (ary , key );
1035
+ rb_ary_push (ary , obj_resurrect ( key ) );
1019
1036
rb_ary_push (ary , value );
1020
1037
return ST_CONTINUE ;
1021
1038
}
@@ -1145,7 +1162,7 @@ iseq_data_to_ary(rb_iseq_t *iseq)
1145
1162
rb_ary_push (ary , INT2FIX (* seq ));
1146
1163
break ;
1147
1164
case TS_VALUE :
1148
- rb_ary_push (ary , * seq );
1165
+ rb_ary_push (ary , obj_resurrect ( * seq ) );
1149
1166
break ;
1150
1167
case TS_ISEQ :
1151
1168
{
Original file line number Diff line number Diff line change 1
1
#define RUBY_VERSION "1.9.1"
2
- #define RUBY_PATCHLEVEL 419
2
+ #define RUBY_PATCHLEVEL 420
3
3
#define RUBY_VERSION_MAJOR 1
4
4
#define RUBY_VERSION_MINOR 9
5
5
#define RUBY_VERSION_TEENY 1
You can’t perform that action at this time.
0 commit comments