Author: jonathan
Date: Fri Dec 5 06:37:53 2008
New Revision: 33509
Modified:
trunk/runtime/parrot/library/P6object.pir
trunk/src/pmc/pmcproxy.pmc
Log:
[core][p6object] PMCProxy should look in the PMC's isa_hash when doing an isa, otherwise we get some wrong answers to isa when inheriting from a PMC that in turn inherits from another PMC. P6Object was relying on the bug in one place, so a correction to that is also in this patch.
Modified: trunk/runtime/parrot/library/P6object.pir
==============================================================================
--- trunk/runtime/parrot/library/P6object.pir (original)
+++ trunk/runtime/parrot/library/P6object.pir Fri Dec 5 06:37:53 2008
@@ -500,10 +500,10 @@
$S0 = typeof x
if $S0 == 'Class' goto done
if $S0 == 'PMCProxy' goto done
- $I0 = isa x, 'String'
- if $I0 goto x_string
$I0 = isa x, 'P6object'
if $I0 goto x_p6object
+ $I0 = isa x, 'String'
+ if $I0 goto x_string
$P0 = typeof x
.return ($P0)
x_p6object:
Modified: trunk/src/pmc/pmcproxy.pmc
==============================================================================
--- trunk/src/pmc/pmcproxy.pmc (original)
+++ trunk/src/pmc/pmcproxy.pmc Fri Dec 5 06:37:53 2008
@@ -257,6 +257,10 @@
if (string_equal(interp, classname, VTABLE_get_string(interp, SELF)) == 0)
return 1;
+ /* Look in the isa hash. */
+ if (parrot_hash_exists(interp, interp->vtables[_proxy->id]->isa_hash, classname))
+ return 1;
+
/* Iterate over all the parents and check if they respond true
* for 'isa' on the original comparison. */
num_classes = VTABLE_elements(interp, _proxy->parents);