]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
ir_block_create_fieldaddress to pass on fieldtype from its input field
authorWolfgang Bumiller <wolfgang.linux@bumiller.com>
Sat, 28 Jul 2012 19:59:34 +0000 (21:59 +0200)
committerWolfgang Bumiller <wolfgang.linux@bumiller.com>
Sat, 28 Jul 2012 19:59:34 +0000 (21:59 +0200)
ir.c

diff --git a/ir.c b/ir.c
index b3d49ec2849607a2e7d8c7dfaa913c2af61f2851..35f00b262c6e607458dfdb86ef6c173d7c6b8cf7 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -1270,6 +1270,8 @@ on_error:
 
 ir_value* ir_block_create_fieldaddress(ir_block *self, const char *label, ir_value *ent, ir_value *field)
 {
+    ir_value *v;
+
     /* Support for various pointer types todo if so desired */
     if (ent->vtype != TYPE_ENTITY)
         return NULL;
@@ -1277,7 +1279,9 @@ ir_value* ir_block_create_fieldaddress(ir_block *self, const char *label, ir_val
     if (field->vtype != TYPE_FIELD)
         return NULL;
 
-    return ir_block_create_general_instr(self, label, INSTR_ADDRESS, ent, field, TYPE_POINTER);
+    v = ir_block_create_general_instr(self, label, INSTR_ADDRESS, ent, field, TYPE_POINTER);
+    v->fieldtype = field->fieldtype;
+    return v;
 }
 
 ir_value* ir_block_create_load_from_ent(ir_block *self, const char *label, ir_value *ent, ir_value *field, int outype)