Created
September 8, 2011 13:18
-
-
Save mlschroe/1203368 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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