zig0

my attempts at zig bootstrapping in C
Log | Files | Refs | README | LICENSE

commit b089809dd1554660e115baa1d3d2647c2c0bc640 (tree)
parent c0ec218e4249cda3f7808aab3e5f6c354dbd1480
Author: Motiejus Jakštys <motiejus.jakstys@chronosphere.io>
Date:   Thu, 24 Apr 2025 20:31:11 +0000

fix listToSpan

Diffstat:
Mparser.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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,