# ISeq#to\_a hides internal\_id

**URL:** <https://www.ruby-forum.com/t/iseq-to-a-hides-internal-id/141330>\
**Category:** Development\
**Created:** [June 24, 2008, 6:41pm UTC](https://www.ruby-forum.com/t/iseq-to-a-hides-internal-id/141330 "2008-06-24T18:41:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yusuke\_ENDOH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/c89c15/32.png) [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Post date:** [June 24, 2008, 6:41pm UTC](https://www.ruby-forum.com/t/iseq-to-a-hides-internal-id/141330/1 "2008-06-24T18:41:56Z")

</div>

e$B1sF#$G$9!#e(B

NODE\_FOR e$B$Ne(B internal\_id e$B$,e(B VM::InstructionSequence#to\_a  
e$B$G=PNOe(B  
e$B$5$l$J$$$?$a!"e(Bto\_a e$B$7$Fe(B load e$B$7$Fe(B eval  
e$B$9$k$HJQ$J$3$H$K$J$j$^$9!#e(B

$ ./ruby -e ’  
VM::InstructionSequence.load(  
VM::InstructionSequence.compile(  
“for i in [1, 2, 3]; p i; end”  
).to\_a  
).eval  
’  
-605544602  
-605544602  
-605544602

e$B$"$s$^$j\<+?.$J$$$G$9$,!"%Q%C%A$r$D$1$^$9!#e(B  
internal\_id e$B$O%P%$%H%3!\<%I\>e$Ge(B nil  
e$B$GI=$9$h$&$K$7$F$\_$^$7$?!#e(B

e$B$D$$$G$K!“e(BVM::InstructionSequence.load  
e$B$r%3%a%s%H%”%&%H$G$O$J$/e(B  
e$B%^%/%m$GL58z2=$9$k$N$O$I$&$G$7$g$&$+!#e(BCFLAGS  
e$B$@$1$GM-8z$K$G$-$ke(B  
e$B$N$G3Z$G$9!#%F%9%H$r$7$F$/$l$ke(B (e$BCOMk$rF’$s$G$/$l$ke(B)  
e$B?M$,A}$($ke(B  
e$B$+$b$7$l$^$;$s!#e(B

# Index: iseq.c

— iseq.c (revision 17564)  
+++ iseq.c (working copy)  
@@ -1034,11 +1034,11 @@  
/\* locals \*/  
for (i=0; ilocal\_table\_size; i++) {  
ID lid = iseq-\>local\_table[i];

- if (lid) {
- 

```
 if (rb_id2str(lid)) rb_ary_push(locals, ID2SYM(lid));

```

- if (lid && rb\_id2str(lid)) {
- 

```
 rb_ary_push(locals, ID2SYM(lid));

```

}  
else {

- 

```
 rb_ary_push(locals, ID2SYM(rb_intern("#arg_rest")));

```

- 

```
 rb_ary_push(locals, Qnil);

```

}  
}

@@ -1299,8 +1299,11 @@  
rb\_define\_method(rb\_cISeq, “eval”, iseq\_eval, 0);

```
 /* disable this feature because there is no verifier. */

```

- /\* rb\_define\_singleton\_method(rb\_cISeq, “load”, iseq\_s\_load, -1);  
\*/  
+#ifdef ANGEROUS\_ISEQ\_LOAD

- rb\_define\_singleton\_method(rb\_cISeq, “load”, iseq\_s\_load, -1);  
+#else  
(void)iseq\_s\_load;  
+#endif

- tbl[i] = FIXNUM\_P(lv) ? FIX2INT(lv) : SYM2ID(CHECK\_SYMBOL(lv));

- tbl[i] = NIL\_P(lv) ? 0 : SYM2ID(CHECK\_SYMBOL(lv));  
}
