From 596a4882bc54dd0cce7366f24456b7f31f39bd74 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Fri, 19 Aug 2022 19:53:55 +0100 Subject: [PATCH] Fixed a print bug with casting --- source/interpreter.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/interpreter.c b/source/interpreter.c index a5d979d..a4dd0b7 100644 --- a/source/interpreter.c +++ b/source/interpreter.c @@ -179,7 +179,10 @@ static bool execPushLiteral(Interpreter* interpreter, bool lng) { static bool execNegate(Interpreter* interpreter) { //negate the top literal on the stack Literal lit = popLiteralArray(&interpreter->stack); - parseIdentifierToValue(interpreter, &lit); + + if (parseIdentifierToValue(interpreter, &lit)) { + return false; + } if (IS_INTEGER(lit)) { lit = TO_INTEGER_LITERAL(-AS_INTEGER(lit)); @@ -365,7 +368,9 @@ static bool execValCast(Interpreter* interpreter) { Literal value = popLiteralArray(&interpreter->stack); Literal type = popLiteralArray(&interpreter->stack); - parseIdentifierToValue(interpreter, &value); + if (!parseIdentifierToValue(interpreter, &value)) { + return false; + } Literal result = TO_NULL_LITERAL;