Ticket #56 (closed bug: fixed)
set_global cannot store subs compiled with :anon into namespace
| Reported by: | pmichaud | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | core | Version: | |
| Severity: | medium | Keywords: | |
| Cc: | Language: | ||
| Patch status: | Platform: |
Description
The set_global opcode is unable to store Sub PMCs that have been compiled with :anon into a namespace. Here's the demonstration code:
$ cat y.pir
.namespace ['Foo']
.sub main :main
.const 'Sub' $P0 = 'bar'
set_global '&!compare_by', $P0
$P2 = get_global '&!compare_by'
say $P2
.end
.namespace []
.sub '' :anon :subid('bar')
noop
.end
$ ./parrot -t1 y.pir
0 set P0, PC11 P0=PMCNULL PC11=Sub=PMC(0x80e6eac pc:12)
3 set_global "&!compare_by", P0 P0=Sub=PMC(0x80e6eac pc:12)
6 get_global P1, "&!compare_by" P1=PMCNULL
9 say P1 P1=PMCNULL
Null PMC in say
current instr.: 'parrot;Foo;main' pc 9 (y.pir:7)
FileHandle objects (like stdout and stderr)are about to be closed, so clearing trace flags.
$
Change History
Note: See
TracTickets for help on using
tickets.
