Ticket #1550 (closed bug: invalid)
lexical lost when cloning a Sub
Reported by: | fperrad | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | core | Version: | 2.2.0 |
Severity: | medium | Keywords: | |
Cc: | Language: | ||
Patch status: | Platform: | all |
Description
when cloning a Sub, we lose lexical variables
.sub 'main' :main .const 'Sub' f = 'func' $P0 = clone f $P0() .end .sub 'func' :lex say "func" $P0 = box 'STATE' .lex 'VAR', $P0 inner() .end .sub 'inner' :lex :outer('func') $P0 = find_lex 'VAR' say $P0 .end
fails with this output:
func Null PMC in say current instr.: 'inner' pc 35 (clone_lex.pir:17) called from Sub 'func' pc 25 (clone_lex.pir:11) called from Sub 'main' pc 8 (clone_lex.pir:4)
Attachments
Change History
Note: See
TracTickets for help on using
tickets.