From f617b08def3f665eef48b9b72382047e80cc08a4 Mon Sep 17 00:00:00 2001 From: otya128 Date: Fri, 23 Dec 2016 17:18:43 +0900 Subject: [PATCH] Fix USE/EXEC error check --- SMILEBASIC/parser.d | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SMILEBASIC/parser.d b/SMILEBASIC/parser.d index 4f09c76..14a6bf5 100644 --- a/SMILEBASIC/parser.d +++ b/SMILEBASIC/parser.d @@ -1111,6 +1111,11 @@ class Parser { lex.popFront(); auto expr = expression(); + if (!expr) + { + syntaxError(); + return null; + } return new Use(expr, lex.location); } break; @@ -1118,6 +1123,11 @@ class Parser { lex.popFront(); auto expr = expression(); + if (!expr) + { + syntaxError(); + return null; + } return new Exec(expr, lex.location); } break;