diff --git a/tools/qfcc/include/expr.h b/tools/qfcc/include/expr.h index dee210ee3..236669a22 100644 --- a/tools/qfcc/include/expr.h +++ b/tools/qfcc/include/expr.h @@ -311,6 +311,7 @@ typedef struct { typedef struct expr_s { expr_t *next; + struct operand_s *op; expr_type type; ///< the type of the result of this expression int line; ///< source line that generated this expression pr_string_t file; ///< source file that generated this expression diff --git a/tools/qfcc/source/statements.c b/tools/qfcc/source/statements.c index ef07cef8c..b48564ab4 100644 --- a/tools/qfcc/source/statements.c +++ b/tools/qfcc/source/statements.c @@ -2046,7 +2046,13 @@ statement_subexpr (sblock_t *sblock, const expr_t *e, operand_t **op) internal_error (e, "unexpected sub-expression type: %s", expr_names[e->type]); - sblock = sfuncs[e->type] (sblock, e, op); + if (e->op) { + *op = e->op; + } else { + sblock = sfuncs[e->type] (sblock, e, op); + //FIXME const cast (store elsewhere) + ((expr_t *) e)->op = *op; + } return sblock; }