Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ void update_references (memory_chunk *old_heap) {
heap_next_obj_iterator(&it);
}
// fix pointers from stack
scan_and_fix_region(old_heap, (void *)__gc_stack_top + sizeof(size_t), (void *)__gc_stack_bottom + sizeof(size_t));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to skip a word from __gc_stack_bottom?

Copy link
Copy Markdown
Contributor Author

@ancavar ancavar May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought __gc_stack_bottom is meant to be exclusive? e.g.

for (size_t *p = (size_t *)(__gc_stack_top + sizeof(size_t)); p < (size_t *)__gc_stack_bottom; ++p) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is exclusive, no?
line 334

scan_and_fix_region(old_heap, (void *)__gc_stack_top + sizeof(size_t), (void *)__gc_stack_bottom);

// fix pointers from extra_roots
scan_and_fix_region_roots(old_heap);
Expand Down
2 changes: 2 additions & 0 deletions runtime/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,8 @@ extern void Lfclose (FILE *f) {
extern void *LreadLine () {
char *buf;

errno = 0;

if (scanf("%m[^\n]", &buf) == 1) {
void *s = Bstring((aint*)&buf);

Expand Down
Loading