}
}
- if (is_const_var > 0)
+ if (is_const_var == CV_CONST)
var->constant = true;
/* Part 1:
if (!localblock) {
cval = (ast_value*)cexp;
- if (!ast_istype(cval, ast_value) || !cval->hasvalue)
+ if (!ast_istype(cval, ast_value) || !cval->hasvalue || !cval->constant)
parseerror(parser, "cannot initialize a global constant variable with a non-constant expression");
else
{
if (opts_standard != COMPILER_GMQCC && !OPTS_FLAG(INITIALIZED_NONCONSTANTS) &&
- is_const_var >= 0)
+ is_const_var != CV_VAR)
{
var->constant = true;
}