Fix off-by-one error with non-closure GC arg

This commit is contained in:
Justin Ethier 2021-07-23 15:46:42 -04:00
parent d99d4a9459
commit da718dcac3
2 changed files with 2 additions and 1 deletions

View file

@ -12,6 +12,7 @@ Bug Fixes
- Properly handle vectors literals at the top level of compiled code. Previously this could lead to segmentation faults (!!) at runtime.
- Fixed a bug in `make-list` that consumed all available memory when passing a negative list length.
- Allow a record type to contain fields that are not initialized by the constructor.
- Fix off-by-one error unpacking arguments when calling a primitive as the continuation after a garbage collection.
Bug Fixes for C Compiler Warnings

2
gc.c
View file

@ -2916,7 +2916,7 @@ void gc_mutator_thread_runnable(gc_thread_data * thd, object result, object mayb
// Collector didn't do anything; make a normal continuation call
if (type_of(thd->gc_cont) == pair_tag || prim(thd->gc_cont)) {
thd->gc_args[0] = result;
Cyc_apply_from_buf(thd, 1, thd->gc_cont, thd->gc_args);
Cyc_apply_from_buf(thd, 2, thd->gc_cont, thd->gc_args);
} else {
object buf[1] = {result};
(((closure) (thd->gc_cont))->fn) (thd, thd->gc_cont, 1, buf);