Browse files

don't call Parrot_pbc_load if the PBC comes straight out of IMCC. IMC…

…C dumps it's code segment directly to interp->code, not to pf->cur_cs, so we don't need it. In other cases, we might need it
  • Loading branch information...
1 parent 950d701 commit 98cd26c99d327715e920c22bff653ac21d46f4d6 @Whiteknight Whiteknight committed Nov 20, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/embed/api.c
@@ -157,10 +157,11 @@ Parrot_api_run_bytecode(ARGMOD(PMC *interp_pmc), ARGIN(PMC *pbc), ARGIN(PMC *mai
EMBED_API_CALLIN(interp_pmc, interp)
- PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
+ PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
if (!pf)
Parrot_ex_throw_from_c_args(interp, NULL, 1, "Could not get packfile");
- Parrot_pbc_load(interp, pf);
+ if (pf->cur_cs != NULL)
+ Parrot_pbc_load(interp, pf);
PackFile_fixup_subs(interp, PBC_IMMEDIATE, NULL);
PackFile_fixup_subs(interp, PBC_POSTCOMP, NULL);
PackFile_fixup_subs(interp, PBC_MAIN, NULL);

0 comments on commit 98cd26c

Please sign in to comment.