Skip to content

Instantly share code, notes, and snippets.

@mlschroe
Created September 8, 2011 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlschroe/1203368 to your computer and use it in GitHub Desktop.
Save mlschroe/1203368 to your computer and use it in GitHub Desktop.
diff --git a/src/call/pcc.c b/src/call/pcc.c
index 401b833..ca1dfc9 100644
--- a/src/call/pcc.c
+++ b/src/call/pcc.c
@@ -316,14 +316,14 @@ Parrot_pcc_invoke_from_sig_object(PARROT_INTERP, ARGIN(PMC *sub_obj),
ASSERT_ARGS(Parrot_pcc_invoke_from_sig_object)
opcode_t *dest;
- const UINTVAL n_regs_used[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
- PMC *ctx = Parrot_push_context(interp, n_regs_used);
PMC * const ret_cont = pmc_new(interp, enum_class_Continuation);
+ if (PMC_IS_NULL(call_object))
+ call_object = Parrot_pmc_new(interp, enum_class_CallContext);
- Parrot_pcc_set_signature(interp, ctx, call_object);
- Parrot_pcc_set_continuation(interp, ctx, ret_cont);
- interp->current_cont = NEED_CONTINUATION;
- PARROT_CONTINUATION(ret_cont)->from_ctx = ctx;
+ Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), call_object);
+ PARROT_CONTINUATION(ret_cont)->from_ctx = call_object;
+ Parrot_pcc_set_continuation(interp, call_object, ret_cont);
+ interp->current_cont = ret_cont;
/* Invoke the function */
dest = VTABLE_invoke(interp, sub_obj, NULL);
@@ -337,9 +337,6 @@ Parrot_pcc_invoke_from_sig_object(PARROT_INTERP, ARGIN(PMC *sub_obj),
runops(interp, offset);
Interp_core_SET(interp, old_core);
}
- Parrot_pop_context(interp);
- Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp),
- Parrot_pcc_get_signature(interp, ctx));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment