Fixed indexAccess potentially going awry with bad inputs

There's always one or two that slip through
This commit is contained in:
2023-02-20 05:07:15 +00:00
parent 87de634e30
commit 3507104121
6 changed files with 61 additions and 33 deletions

View File

@@ -265,7 +265,9 @@ static bool execPrint(Toy_Interpreter* interpreter) {
Toy_freeLiteral(idn);
}
Toy_printLiteralCustom(lit, interpreter->printOutput);
if (!TOY_IS_IDENTIFIER(lit)) {
Toy_printLiteralCustom(lit, interpreter->printOutput);
}
Toy_freeLiteral(lit);