Skip to content

Commit

Permalink
attempted fix for EventHandler.invoke, since it obviously hadn't been…
Browse files Browse the repository at this point in the history
… updated since before the big PCC refactors several months ago. This VTABLE is untested, though tests are in development
  • Loading branch information
Whiteknight committed Dec 28, 2010
1 parent b3af8c9 commit b3de476
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/pmc/eventhandler.pmc
Expand Up @@ -234,16 +234,21 @@ Runs the contained code, if any; this is what handles the event.
*/
VTABLE opcode_t *invoke(void *next) {
Parrot_EventHandler_attributes * const e = PARROT_EVENTHANDLER(SELF);
Interp * target_interp = NULL;
opcode_t * real_next = NULL;

/* can't invoke on INTERP and can't return its result; this may not be
* the right interpreter */
if (e) {
void *unused;
if (!e)
return next;

unused = VTABLE_invoke(PMC_data_typed(e->interp, Parrot_Interp),
e->code, next);
UNUSED(unused);
}
if (!PMC_IS_NULL(e->interp))
target_interp = PMC_data_typed(e->interp, Interp *);
if (target_interp == NULL)
target_interp = INTERP;

if (PMC_IS_NULL(e->code))
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"No code object to execute in EventHandler");
Parrot_pcc_invoke_sub_from_c_args(target_interp, e->code, "->");

return (opcode_t *)next;
}
Expand Down

0 comments on commit b3de476

Please sign in to comment.