Skip to content

Instantly share code, notes, and snippets.

@MasterDuke17
Created August 1, 2021 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MasterDuke17/213ffde52c64e0a810d2f34083e02bac to your computer and use it in GitHub Desktop.
Save MasterDuke17/213ffde52c64e0a810d2f34083e02bac to your computer and use it in GitHub Desktop.
diff --git src/disp/program.c src/disp/program.c
index a411ed168..2f2584c5a 100644
--- src/disp/program.c
+++ src/disp/program.c
@@ -1967,7 +1967,7 @@ static void emit_args_ops(MVMThreadContext *tc, MVMCallStackDispatchRecord *reco
Action action;
MVMuint32 index;
} ArgProduction;
- ArgProduction arg_prod[num_to_produce];
+ ArgProduction *arg_prod = MVM_malloc(num_to_produce * sizeof(ArgProduction));
for (i = 0; i < num_to_produce; i++) {
/* Work out the source of this arg in the capture. For the rationale
* for this algorithm, see MVM_disp_program_record_track_arg. */
@@ -2038,6 +2038,8 @@ static void emit_args_ops(MVMThreadContext *tc, MVMCallStackDispatchRecord *reco
MVM_VECTOR_PUSH(cs->ops, op);
}
+ MVM_free(arg_prod);
+
/* Finally, the instruction to copy what we can from the args tail. */
MVMDispProgramOp op;
op.code = MVMDispOpcodeCopyArgsTail;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment