From: Wolfgang (Blub) Bumiller Date: Thu, 23 Aug 2012 11:30:30 +0000 (+0200) Subject: fix: check if parsing a variable initializer failed X-Git-Tag: 0.1-rc1~74 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5022f716dcaefdc8b1e6fe45f1ecb8865921d9ec;p=xonotic%2Fgmqcc.git fix: check if parsing a variable initializer failed --- diff --git a/parser.c b/parser.c index 0773026..657a35f 100644 --- a/parser.c +++ b/parser.c @@ -2509,6 +2509,11 @@ nextvar: ast_value *cval; cexp = parser_expression_leave(parser, true); + if (!cexp) { + ast_value_delete(typevar); + return false; + } + cval = (ast_value*)cexp; if (!ast_istype(cval, ast_value) || !cval->isconst) parseerror(parser, "cannot initialize a global constant variable with a non-constant expression");