Found and fixed a memory leak in the rope strings

Also fixed a bit manipulation error in the GC.
This commit is contained in:
2026-05-10 15:39:04 +10:00
parent 3b813da1cf
commit 83fb5222a2
9 changed files with 124 additions and 6 deletions
+2 -1
View File
@@ -210,7 +210,7 @@ static void processAssign(Toy_VM* vm) {
Toy_Value name = Toy_popStack(&vm->stack);
//assign it
Toy_assignScope(vm->scope, TOY_VALUE_AS_STRING(name), Toy_copyValue(&vm->memoryBucket, value)); //scope now owns the value, doesn't need to be freed
Toy_assignScope(vm->scope, TOY_VALUE_AS_STRING(name), Toy_copyValue(&vm->memoryBucket, value));
//in case of chaining, leave a copy on the stack
bool chainedAssignment = READ_BYTE(vm);
@@ -220,6 +220,7 @@ static void processAssign(Toy_VM* vm) {
//cleanup
Toy_freeValue(name);
Toy_freeValue(value);
}
static void processAssignCompound(Toy_VM* vm) {