aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/glsl/glsl.g
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/glsl/glsl.g')
-rw-r--r--src/libs/glsl/glsl.g2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libs/glsl/glsl.g b/src/libs/glsl/glsl.g
index 314cef0bb7..ee9aab833c 100644
--- a/src/libs/glsl/glsl.g
+++ b/src/libs/glsl/glsl.g
@@ -576,6 +576,8 @@ AST *Parser::parse(int startToken)
if (yytoken != -1) {
const QLatin1String s(spell[yytoken]);
message = QString::fromLatin1("Unexpected token `%1'").arg(s);
+ if (yytoken == 0) // do not freeze on unexpected end of file
+ return nullptr;
}
for (; _tos; --_tos) {