From 3949be370631bd6d77383bc77ab4c30ba04fd0b0 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sun, 5 Feb 2023 13:34:39 +0000 Subject: [PATCH] Quick potential bugfix --- repl/lib_compound.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/repl/lib_compound.c b/repl/lib_compound.c index 2b2ca90..a7c9850 100644 --- a/repl/lib_compound.c +++ b/repl/lib_compound.c @@ -171,6 +171,12 @@ static int nativeToString(Toy_Interpreter* interpreter, Toy_LiteralArray* argume Toy_freeLiteral(selfLiteralIdn); } + //BUGFIX: probably an undefined variable + if (TOY_IS_IDENTIFIER(selfLiteral)) { + Toy_freeLiteral(selfLiteral); + return -1; + } + //print it to a custom function Toy_printLiteralCustom(selfLiteral, toStringUtil);