mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
Fix folding logic for conditions.
This commit is contained in:
parent
a7c1f6f021
commit
51ef277e21
1 changed files with 1 additions and 1 deletions
2
fold.c
2
fold.c
|
@ -765,7 +765,7 @@ int fold_cond(ir_value *condval, ast_function *func, ast_ifthen *branch) {
|
|||
ast_expression_codegen *cgen;
|
||||
ir_block *elide;
|
||||
ir_value *dummy;
|
||||
bool istrue = (fold_immvalue_float(condval) == 1.0f && branch->on_true);
|
||||
bool istrue = (fold_immvalue_float(condval) != 0.0f && branch->on_true);
|
||||
bool isfalse = (fold_immvalue_float(condval) == 0.0f && branch->on_false);
|
||||
ast_expression *path = (istrue) ? branch->on_true :
|
||||
(isfalse) ? branch->on_false : NULL;
|
||||
|
|
Loading…
Reference in a new issue