Skip to content
Browse files

make sure to set :main() args in the iglobals array. This makes ops2c…

… run again. The build appears to complete. Also, fix a warning in EMBED_API_CALLIN where we were doing an assignment in the if() condition without parenthesis
  • Loading branch information...
1 parent 7e25808 commit 9f7a94c5a8fcf4cbca54d24a441de7024a8238b0 @Whiteknight Whiteknight committed
Showing with 3 additions and 1 deletion.
  1. +2 −0 src/embed/api.c
  2. +1 −1 src/embed/embed_private.h
View
2 src/embed/api.c
@@ -179,6 +179,7 @@ Parrot_api_run_bytecode(ARGMOD(PMC *interp_pmc), ARGIN(PMC *pbc), ARGIN(PMC *mai
PMC * main_sub = NULL;
PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
+
if (!pf)
Parrot_ex_throw_from_c_args(interp, NULL, 1, "Could not get packfile");
if (pf->cur_cs != NULL)
@@ -196,6 +197,7 @@ Parrot_api_run_bytecode(ARGMOD(PMC *interp_pmc), ARGIN(PMC *pbc), ARGIN(PMC *mai
Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), NULL);
Parrot_pcc_set_constants(interp, interp->ctx, interp->code->const_table);
+ VTABLE_set_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_ARGV_LIST, mainargs);
Parrot_ext_call(interp, main_sub, "P->", mainargs);
EMBED_API_CALLOUT(interp_pmc, interp)
}
View
2 src/embed/embed_private.h
@@ -15,7 +15,7 @@
(i)->lo_var_ptr = &_oldtop; \
(i)->final_error = NULL; \
(i)->api_jmp_buf = &env; \
- if (exit_code = setjmp(env)) { \
+ if ((exit_code = setjmp(env))) { \
/* exit code is incremented in 1 since \
* longjmp can't return 0 \
* exit_code = 1 -> normal exit \

0 comments on commit 9f7a94c

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