Quick potential bugfix

This commit is contained in:
2023-02-05 13:34:39 +00:00
parent 0e932f24cc
commit 3949be3706

View File

@@ -171,6 +171,12 @@ static int nativeToString(Toy_Interpreter* interpreter, Toy_LiteralArray* argume
Toy_freeLiteral(selfLiteralIdn); Toy_freeLiteral(selfLiteralIdn);
} }
//BUGFIX: probably an undefined variable
if (TOY_IS_IDENTIFIER(selfLiteral)) {
Toy_freeLiteral(selfLiteral);
return -1;
}
//print it to a custom function //print it to a custom function
Toy_printLiteralCustom(selfLiteral, toStringUtil); Toy_printLiteralCustom(selfLiteral, toStringUtil);