mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-20 18:32:01 +00:00
propagate the 'inexact' flag on when initializing a constant
This commit is contained in:
parent
68c2baa7c1
commit
536138273f
1 changed files with 8 additions and 1 deletions
9
parser.c
9
parser.c
|
@ -5842,7 +5842,6 @@ skipvar:
|
|||
else
|
||||
{
|
||||
var->hasvalue = true;
|
||||
var->inexact = ((ast_value*)cexp)->inexact;
|
||||
if (cval->expression.vtype == TYPE_STRING)
|
||||
var->constval.vstring = parser_strdup(cval->constval.vstring);
|
||||
else if (cval->expression.vtype == TYPE_FIELD)
|
||||
|
@ -5873,6 +5872,14 @@ skipvar:
|
|||
vec_free(sy.argc);
|
||||
var->cvq = cvq;
|
||||
}
|
||||
/* a constant initialized to an inexact value should be marked inexact:
|
||||
* const float x = <inexact>; should propagate the inexact flag
|
||||
*/
|
||||
if (var->cvq == CV_CONST && var->expression.vtype == TYPE_FLOAT) {
|
||||
cval = (ast_value*)cexp;
|
||||
if (ast_istype(cexp, ast_value) && cval->hasvalue && cval->cvq == CV_CONST)
|
||||
var->inexact = cval->inexact;
|
||||
}
|
||||
}
|
||||
|
||||
another:
|
||||
|
|
Loading…
Reference in a new issue