forked from ground/ground
Fix memory leak in Ground REPL, remove persistent labels to avoid UB
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@ build
|
||||
ground
|
||||
groundc
|
||||
.idea
|
||||
Makefile
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Ground REPL (when ground is ran without any arguments)
|
||||
* Ground REPL (shows when ground is ran without any arguments)
|
||||
* Copyright (C) 2026 DiamondNether90
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -36,6 +36,7 @@ int repl() {
|
||||
scope.isMainScope = true;
|
||||
while (true) {
|
||||
Estr programString = CREATE_ESTR("");
|
||||
*scope.labels = NULL;
|
||||
|
||||
// Get program
|
||||
printf(">>> ");
|
||||
@@ -52,6 +53,7 @@ int repl() {
|
||||
GroundProgram program = createGroundProgram();
|
||||
program = parseFile(programString.str);
|
||||
interpretGroundProgram(&program, &scope);
|
||||
freeGroundProgram(&program);
|
||||
|
||||
DESTROY_ESTR(programString);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user