Skip to content

Commit

Permalink
Prevent GC messing up bytecode -> file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Oct 5, 2013
1 parent 4d45b76 commit b674414
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mast/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ void MVM_mast_to_file(MVMThreadContext *tc, MVMObject *mast, MVMObject *types, M

/* Turn the MAST tree into bytecode. */
unsigned int size;
char *bytecode = MVM_mast_compile(tc, mast, mnt, &size);
char *bytecode;
MVM_gc_allocate_gen2_default_set(tc);
bytecode = MVM_mast_compile(tc, mast, mnt, &size);
free(mnt);
MVM_gc_allocate_gen2_default_clear(tc);

/* Write it out to a file. (Not using VM-level IO for this right now;
* may want to do that, but really we just want to shove the bytes out
Expand Down

0 comments on commit b674414

Please sign in to comment.