diff --git a/parser.c b/parser.c index 9d11d47..cd0f182 100644 --- a/parser.c +++ b/parser.c @@ -50,7 +50,7 @@ static void cleanupScratch(CleanupScratch* c) { c->scratch->len = c->old_len; } static AstSubRange listToSpan( Parser* p, const AstNodeIndex* list, uint32_t count) { SLICE_ENSURE_CAPACITY(AstNodeIndex, &p->extra_data, count); - memcpy(p->extra_data.arr, list, count * sizeof(AstNodeIndex)); + memcpy(p->extra_data.arr + p->extra_data.len, list, count * sizeof(AstNodeIndex)); p->extra_data.len += count; return (AstSubRange) { .start = p->extra_data.len - count,