Fix bug with calling convention.

Stack frames were increasing with size every function
call and overwriting other stuff, resulting in some issues with gc.
This commit is contained in:
Calvin Rose 2017-04-24 18:42:08 -04:00
parent 652b250718
commit c33d4da994
1 changed files with 2 additions and 1 deletions

View File

@ -251,6 +251,7 @@ int gst_continue(Gst *vm) {
uint16_t newStackIndex = gst_frame_args(stack);
uint16_t size = gst_frame_size(stack);
temp = stack[pc[1]];
gst_frame_size(stack) = newStackIndex - GST_FRAME_SIZE;
gst_frame_ret(stack) = pc[2];
gst_frame_pc(stack) = pc + 3;
if (newStackIndex < GST_FRAME_SIZE)
@ -452,7 +453,7 @@ void gst_init(Gst *vm) {
* a collection pretty much every cycle, which is
* obviously horrible for performance, but helps ensure
* there are no memory bugs during dev */
vm->memoryInterval = 2000;
vm->memoryInterval = 0;
vm->black = 0;
/* Add thread */
vm->thread = NULL;