Permalink
Browse files

Workaround for handling tailcalls in Subs.

  • Loading branch information...
1 parent 4646b11 commit eeaf8b33439cab6edd64257a725728125057e43c @bacek bacek committed Mar 15, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/pmc/sub.pmc
View
@@ -425,8 +425,10 @@ Invokes the subroutine.
Parrot_pcc_free_registers(INTERP, context);
Parrot_pcc_allocate_registers(INTERP, context, sub->n_regs_used);
- /* Preserve object */
- object = Parrot_pcc_get_object(INTERP, signature);
+ /* Preserve object. If any. XXX We should always have it... */
+ if (!PMC_IS_NULL(signature))
+ object = Parrot_pcc_get_object(INTERP, signature);
+
Parrot_pcc_init_context(INTERP, context, caller_ctx);
Parrot_pcc_set_object(INTERP, context, object);

0 comments on commit eeaf8b3

Please sign in to comment.