fix a bunch of memory bugs

This commit is contained in:
2026-07-04 19:59:00 +10:00
parent 5337a9e375
commit a913b3b24a
5 changed files with 17 additions and 8 deletions

View File

@@ -238,7 +238,7 @@ GroundBytecode _GroundNewBytecode(GroundProgram* program, GroundState* state) {
if (Ground.Flags.error) return bytecode;
// Allocate heap
bytecode.heap.heap = malloc(sizeof(GroundValue) * size);
bytecode.heap.heap = malloc(sizeof(GroundBytecodeValue) * size);
if (bytecode.heap.heap == NULL) {
Ground.Log.Error("malloc failed in Ground.New.Bytecode");
Ground.Flags.error = true;