[svn:parrot] r37572 - in trunk: src/pmc t/pmc
cotto at svn.parrot.org
cotto at svn.parrot.org
Thu Mar 19 01:10:43 UTC 2009
Author: cotto
Date: Thu Mar 19 01:10:43 2009
New Revision: 37572
URL: https://trac.parrot.org/parrot/changeset/37572
Log:
[PMC] make PMCProxy isa work when not proxying anything
fuzzing++
Modified:
trunk/src/pmc/pmcproxy.pmc
trunk/t/pmc/pmcproxy.t
Modified: trunk/src/pmc/pmcproxy.pmc
==============================================================================
--- trunk/src/pmc/pmcproxy.pmc Thu Mar 19 00:47:59 2009 (r37571)
+++ trunk/src/pmc/pmcproxy.pmc Thu Mar 19 01:10:43 2009 (r37572)
@@ -295,7 +295,8 @@
return 1;
/* Look in the isa hash. */
- if (parrot_hash_exists(interp, interp->vtables[_proxy->id]->isa_hash, classname))
+ if (interp->vtables[_proxy->id] != NULL &&
+ parrot_hash_exists(interp, interp->vtables[_proxy->id]->isa_hash, classname))
return 1;
/* Iterate over all the parents and check if they respond true
@@ -333,7 +334,8 @@
return 1;
/* Look in the isa hash. */
- if (parrot_hash_exists(interp, interp->vtables[_proxy->id]->isa_hash, classname))
+ if (interp->vtables[_proxy->id] != NULL &&
+ parrot_hash_exists(interp, interp->vtables[_proxy->id]->isa_hash, classname))
return 1;
return 0;
Modified: trunk/t/pmc/pmcproxy.t
==============================================================================
--- trunk/t/pmc/pmcproxy.t Thu Mar 19 00:47:59 2009 (r37571)
+++ trunk/t/pmc/pmcproxy.t Thu Mar 19 01:10:43 2009 (r37572)
@@ -18,7 +18,7 @@
.sub main :main
.include 'include/test_more.pir'
- plan(44)
+ plan(45)
new_tests()
get_class_tests()
@@ -36,6 +36,9 @@
new $P0, ['PMCProxy']
ok(1, "new PMCProxy didn't explode")
isa_ok($P0, "PMCProxy")
+
+ $I0 = isa $P0, 'Foo'
+ is($I0, 0, "non-default isa on PMCProxy works")
.end
More information about the parrot-commits
mailing list