[svn:parrot] r44469 - branches/exceptions_refactor/src/ops
tene at svn.parrot.org
tene at svn.parrot.org
Thu Feb 25 04:18:50 UTC 2010
Author: tene
Date: Thu Feb 25 04:18:47 2010
New Revision: 44469
URL: https://trac.parrot.org/parrot/changeset/44469
Log:
Allow subclasses of Exception to be thrown
Modified:
branches/exceptions_refactor/src/ops/core.ops
Modified: branches/exceptions_refactor/src/ops/core.ops
==============================================================================
--- branches/exceptions_refactor/src/ops/core.ops Thu Feb 25 03:53:33 2010 (r44468)
+++ branches/exceptions_refactor/src/ops/core.ops Thu Feb 25 04:18:47 2010 (r44469)
@@ -777,7 +777,7 @@
opcode_t *dest;
opcode_t *const ret = expr NEXT();
PMC *resume = new_ret_continuation_pmc(interp, ret);
- if (PMC_IS_NULL(except) || except->vtable->base_type != enum_class_Exception)
+ if (PMC_IS_NULL(except) || ! VTABLE_isa(interp, except, Parrot_str_new_constant(interp, "Exception")))
except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
EXCEPTION_UNIMPLEMENTED,
Parrot_str_new_constant(interp, "Not a throwable object"));
@@ -790,7 +790,7 @@
inline op throw(invar PMC, invar PMC) :flow {
opcode_t * dest;
PMC * except = $1;
- if (PMC_IS_NULL(except) || except->vtable->base_type != enum_class_Exception)
+ if (PMC_IS_NULL(except) || ! VTABLE_isa(interp, except, Parrot_str_new_constant(interp, "Exception")))
except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
EXCEPTION_UNIMPLEMENTED,
Parrot_str_new_constant(interp, "Not a throwable object"));
More information about the parrot-commits
mailing list