1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 02:59:54 +00:00

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

View File

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