Null pointer exceptions in parser unary function

This commit is contained in:
2023-01-15 18:15:59 +00:00
parent 51740e2b9e
commit aeecfabbbc
4 changed files with 22 additions and 5 deletions

View File

@@ -69,7 +69,7 @@ unsigned char* compileString(char* source, size_t* size) {
while(node != NULL) {
//pack up and leave
if (node->type == AST_NODE_ERROR) {
printf(ERROR "error node detected\n" RESET);
errorsTriggered++;
freeASTNode(node);
freeCompiler(&compiler);
freeParser(&parser);
@@ -131,6 +131,8 @@ int main() {
"declare-types-dictionary-key.toy",
"declare-types-dictionary-value.toy",
"index-arrays-non-integer.toy",
"unary-inverted-nothing.toy",
"unary-negative-nothing.toy",
NULL
};