Ticket #715 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

[bug] various operations create (incorrect) PMCProxy objects in HLL namespaces

Reported by: pmichaud Owned by:
Priority: blocker Milestone:
Component: core Version: 1.2.0
Severity: high Keywords: tcl blocker
Cc: coke Language: tcl
Patch status: Platform:

Description

I'm opening this ticket from the thread starting at  http://lists.parrot.org/pipermail/parrot-dev/2009-May/002297.html . Essentially, there are a variety of operations that can cause PMCProxy objects to be incorrectly generated in HLL namespaces.

Here's an example:

$ ./parrot --version
This is Parrot version 1.2.0-devel built for i386-linux.
Copyright (C) 2001-2009, Parrot Foundation.

This code is distributed under the terms of the Artistic License 2.0.
For more details, see the full text of the license in the LICENSE file
included in the Parrot source tree.

$ cat x.pir
.HLL 'foo'

.sub 'main' :main
    $P0 = new 'Class'
    $I0 = isa $P0, 'Sub'

    $P1 = get_root_global ['foo'], 'Sub'
    say $P1
.end

$ ./parrot x.pir
Sub
$ 

Clearly an entry for 'Sub' should not be made in the foo? HLL namespace.

This behavior did not exist in 1.0.0 (which means we need to correct it prior to 1.4 release).

$ ./parrot --version
This is Parrot version 1.0.0-devel built for i386-linux.
Copyright (C) 2001-2009, Parrot Foundation.

This code is distributed under the terms of the Artistic License 2.0.
For more details, see the full text of the license in the LICENSE file
included in the Parrot source tree.

$ cat x.pir
.HLL 'foo'

.sub 'main' :main
    $P0 = new 'Class'
    $I0 = isa $P0, 'Sub'

    $P1 = get_root_global ['foo'], 'Sub'
    say $P1
.end

$ ./parrot x.pir
Null PMC in say
current instr.: 'main' pc 11 (x.pir:8)
$ 

I suspect that ultimately the bug is that Parrot_oo_get_class and Parrot_oo_get_class_str are creating PMCProxy objects in namespaces they have no business creating things in.

IIUC, partcl is currently blocking on this ticket.

Pm

Change History

Changed 5 years ago by coke

  • keywords tcl blocker added

Changed 5 years ago by coke

  • cc coke added

Changed 5 years ago by coke

The patch NotFound pasted at:  http://nopaste.snit.ch/16698 resolves the issue exposed by partcl's [namespace children] test.

Changed 5 years ago by NotFound

Applied a cleaned version of the patch in r39220.

Changed 5 years ago by NotFound

Added the example as a test in t/oo/proxy.t on r39222

Changed 5 years ago by coke

18:45 pmichaud    Coke:  Can you confirm that TT #715 has been fixed for you?

Yes, thanks.

Changed 5 years ago by pmichaud

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.