P6metaclass.register does not catch second registration of PMC Class #594

Open
aghast opened this Issue Feb 26, 2010 · 2 comments

Comments

Projects
None yet
2 participants

aghast commented Feb 26, 2010

Registering a PMC class works. Registering the same class a second time does not produce a diagnostic - although attempting to register a non-PMC class twice does.

Also, the second register produces some horrible results.

main();

sub main() {
    pir::load_bytecode('dumper.pbc');
    pir::load_bytecode('P6object.pbc');
    my $nsp;


    $nsp := Q:PIR {
        %r = get_hll_namespace ['Key']
    };
    _dumper($nsp);

    P6metaclass.register('Key');

    $nsp := Q:PIR {
        %r = get_hll_namespace ['Key']
    };
    _dumper($nsp);


    P6metaclass.register('Key');

    $nsp := Q:PIR {
        %r = get_hll_namespace ['Key']
    };
    _dumper($nsp);
}

Originally http://trac.parrot.org/parrot/ticket/1481

aghast commented Aug 9, 2010

This bug is still present in 2.6. At this time, doubly-registering the namespace causes the namespace to be removed - get_root_namespace will return null.

@ghost

ghost commented Aug 9, 2010

Here is a pure pir version of the example:

.sub main
    load_bytecode 'dumper.pbc'
    load_bytecode 'P6object.pbc'
    .local pmc r
    r = get_hll_namespace ['Key']
    _dumper(r)
    .local pmc P6metaclass
    P6metaclass = get_global 'P6metaclass'
    P6metaclass.'register'('Key')
    r = get_hll_namespace ['Key']
    _dumper(r)
    P6metaclass.'register'('Key')
    r = get_hll_namespace ['Key']
    _dumper(r)
.end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment