Skip to content
This repository
Browse code

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...
commit 98cd26c99d327715e920c22bff653ac21d46f4d6 1 parent 950d701
Andrew Whitworth Whiteknight authored

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 src/embed/api.c
5 src/embed/api.c
@@ -157,10 +157,11 @@ Parrot_api_run_bytecode(ARGMOD(PMC *interp_pmc), ARGIN(PMC *pbc), ARGIN(PMC *mai
157 157 {
158 158 ASSERT_ARGS(Parrot_api_run_bytecode)
159 159 EMBED_API_CALLIN(interp_pmc, interp)
160   - PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
  160 + PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
161 161 if (!pf)
162 162 Parrot_ex_throw_from_c_args(interp, NULL, 1, "Could not get packfile");
163   - Parrot_pbc_load(interp, pf);
  163 + if (pf->cur_cs != NULL)
  164 + Parrot_pbc_load(interp, pf);
164 165 PackFile_fixup_subs(interp, PBC_IMMEDIATE, NULL);
165 166 PackFile_fixup_subs(interp, PBC_POSTCOMP, NULL);
166 167 PackFile_fixup_subs(interp, PBC_MAIN, NULL);

0 comments on commit 98cd26c

Please sign in to comment.
Something went wrong with that request. Please try again.