Hi,

At Fri, 18 May 2007 05:05:24 +0900,
Paul Brannan wrote in [ruby-core:11199]:
> Now 'a' shows up twice in the local table:
> 
> == disasm: <ISeq:<main>@<compiled>>=====================================
> == catch table
> | catch type: retry  st: 0002 ed: 0010 sp: 0000 cont: 0002
> |------------------------------------------------------------------------
> local table (size: 3, argc: 0 [opts: 0, rest: -1, post: 0, block: -1] c)
> [ 3] ?          [ 2] a          [ 1] a          
> 0000 trace            1
> 0002 newarray         0
> 0004 send             :each, 0, block in <main>, 0, <ic>
> 0010 leave            

It differs from what I got.

$ ./miniruby -e 'i = VM::InstructionSequence.new("for a in []; end"); puts i.disasm'
== disasm: <ISeq:<main>@<compiled>>=====================================
== catch table
| catch type: retry  st: 0002 ed: 0010 sp: 0000 cont: 0002
|------------------------------------------------------------------------
local table (size: 2, argc: 0 [opts: 0, rest: -1, post: 0, block: -1] c)
[ 2] a          [ 1] ?
0000 trace            1                                               (   1)
0002 newarray         0
0004 send             :each, 0, block in <main>, 0, <ic>
0010 leave
== disasm: <ISeq:block in <main>@<compiled>>============================
== catch table
| catch type: redo   st: 0005 ed: 0006 sp: 0000 cont: 0005
| catch type: next   st: 0005 ed: 0006 sp: 0000 cont: 0006
|------------------------------------------------------------------------
local table (size: 1, argc: 1 [opts: 0, rest: -1, post: 0, block: -1] s)
[ 1] ?<Arg>
0000 getdynamic       *, 0                                            (   1)
0003 setlocal         a
0005 putnil
0006 leave                                                            (   1)

-- 
Nobu Nakada