Fix bad memory access in ReplaceAll

This commit is contained in:
Krzosa Karol
2026-03-05 16:55:58 +01:00
parent 52c55e27d9
commit 9b2c8626d4
4 changed files with 7 additions and 2 deletions

View File

@@ -1152,6 +1152,7 @@ API void InitBuffer(Allocator allocator, Buffer *buffer, BufferID id = {}, Strin
if (!buffer->no_line_starts) {
Add(&buffer->line_starts, (Int)0);
}
if (DebugTraceBufferInits) printf("InitBuffer %.*s %p\n", (int)name.len, name.data, buffer->data);
}
API void DeinitBuffer(Buffer *buffer) {
@@ -1161,6 +1162,7 @@ API void DeinitBuffer(Buffer *buffer) {
Dealloc(&buffer->line_starts);
DeallocHistoryArray(&buffer->undo_stack);
DeallocHistoryArray(&buffer->redo_stack);
if (DebugTraceBufferInits) printf("DeinitBuffer %.*s %p\n", (int)buffer->name.len, buffer->name.data, buffer->data);
}
// Indexing starts from 0 not 1 because this routine creates also the zero buffer