From f24de89a2adfeb7cbfa48c8d4185dbae8dcfe3ce Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 13 Feb 2011 14:13:32 +0900 Subject: [PATCH] Handle type-modified constants. The fix for pointers broke constants (particularly, enums). Oops. --- tools/qfcc/source/emit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/emit.c b/tools/qfcc/source/emit.c index 1199b2f11..677a3e57d 100644 --- a/tools/qfcc/source/emit.c +++ b/tools/qfcc/source/emit.c @@ -72,7 +72,10 @@ get_value_def (ex_value_t *value, etype_t type) def->offset = value->v.short_val; return def; } - return emit_value (value, 0); + def = emit_value (value, 0); + if (type != def->type->type) + return alias_def (def, ev_types[type]); + return def; } static def_t *