aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index 967b142425..de0bae7234 100644
--- a/iseq.c
+++ b/iseq.c
@@ -21,6 +21,8 @@
VALUE rb_cISeq;
+#define hidden_obj_p(obj) (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass)
+
static void
compile_data_free(struct iseq_compile_data *compile_data)
{
@@ -699,6 +701,16 @@ insn_operand_intern(rb_iseq_t *iseq,
op = ID2SYM(op);
case TS_VALUE: /* VALUE */
+ if (hidden_obj_p(op)) {
+ switch (BUILTIN_TYPE(op)) {
+ case T_STRING:
+ op = rb_str_replace(rb_str_new(0, 0), op);
+ break;
+ case T_ARRAY:
+ op = rb_ary_replace(rb_ary_new2(0), op);
+ break;
+ }
+ }
ret = rb_inspect(op);
if (CLASS_OF(op) == rb_cISeq) {
rb_ary_push(child, op);