petdance/scratch — Issue #926: NQPrx does not vivify globals in all cases
Author: petdance
Created: 2011-11-14 06:14:02+00:00
State: open
Labels: bug, nqp, Pri-normal, Sev-medium

This code:
```
module Z;
our $Global;
sub zzz() {
unless $Global {
say("Not set");
}
}
INIT {
zzz();
}

module A;

sub aaa() {
our $G2;

unless $G2 {
say("Not set");
}
}
```

generates:
```
get_global $P21, "$Global"
unless $P21, unless_20
```

for the access code in `sub zzz`. There is no guard for null. But in the access code in `sub aaa` there is this:
```
get_global $P31, "$G2"
unless_null $P31, vivify_17
```
Apparently the scope isn't being looked up correctly, or something?

Originally http://trac.parrot.org/parrot/ticket/1308 by Austin_Hastings