This commit is contained in:
2022-09-03 09:47:08 +01:00
parent e6fe42c0ca
commit c039045c14

View File

@@ -617,8 +617,12 @@ static bool execNegate(Interpreter* interpreter) {
//negate the top literal on the stack (numbers only) //negate the top literal on the stack (numbers only)
Literal lit = popLiteralArray(&interpreter->stack); Literal lit = popLiteralArray(&interpreter->stack);
if (!parseIdentifierToValue(interpreter, &lit)) { if (IS_IDENTIFIER(lit)) {
return false; Literal idn = lit;
if (!parseIdentifierToValue(interpreter, &lit)) {
return false;
}
freeLiteral(idn);
} }
else if (IS_INTEGER(lit)) { else if (IS_INTEGER(lit)) {
@@ -648,8 +652,12 @@ static bool execInvert(Interpreter* interpreter) {
//negate the top literal on the stack (booleans only) //negate the top literal on the stack (booleans only)
Literal lit = popLiteralArray(&interpreter->stack); Literal lit = popLiteralArray(&interpreter->stack);
if (!parseIdentifierToValue(interpreter, &lit)) { if (IS_IDENTIFIER(lit)) {
return false; Literal idn = lit;
if (!parseIdentifierToValue(interpreter, &lit)) {
return false;
}
freeLitreral(idn);
} }
if (IS_BOOLEAN(lit)) { if (IS_BOOLEAN(lit)) {
@@ -959,8 +967,12 @@ static bool execValCast(Interpreter* interpreter) {
Literal value = popLiteralArray(&interpreter->stack); Literal value = popLiteralArray(&interpreter->stack);
Literal type = popLiteralArray(&interpreter->stack); Literal type = popLiteralArray(&interpreter->stack);
if (!parseIdentifierToValue(interpreter, &value)) { if (IS_IDENTIFIER(value)) {
return false; Literal idn = value;
if (!parseIdentifierToValue(interpreter, &value)) {
return false;
}
freeLiteral(idn);
} }
Literal result = TO_NULL_LITERAL; Literal result = TO_NULL_LITERAL;