Patched segault in parser

This commit is contained in:
2023-02-09 12:37:18 +00:00
parent 932401c26d
commit e946a5f071
4 changed files with 7 additions and 49 deletions

View File

@@ -1220,7 +1220,7 @@ static void parsePrecedence(Toy_Parser* parser, Toy_ASTNode** nodeHandle, Preced
Toy_emitASTNodeBinary(nodeHandle, rhsNode, opcode);
//optimise away the constants
if (!calcStaticBinaryArithmetic(parser, nodeHandle)) {
if (!parser->panic && !calcStaticBinaryArithmetic(parser, nodeHandle)) {
return;
}
}