aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandros Naskos <alex_naskos@hotmail.com>2018-04-24 16:50:36 +0300
committerAlexandros Naskos <alex_naskos@hotmail.com>2018-04-24 16:50:36 +0300
commit189e8e97bdd8dea8efa9ea30401b164ea619f2e4 (patch)
tree881a86844d1030591ec85b2614f5a5e4e77f696a
parent0e5fb035e3d12879b4bd7a23578fdb8932deb4d1 (diff)
downloadzig-189e8e97bdd8dea8efa9ea30401b164ea619f2e4.tar.gz
zig-189e8e97bdd8dea8efa9ea30401b164ea619f2e4.zip
PointerInfo child is a pointer to a TypeInfo union, still not working correctly
-rw-r--r--src/ir.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 3ba9bc4772..86c718da81 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -15867,7 +15867,11 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, ConstExprValue *p
fields[3].type = get_pointer_to_type(ira->codegen, type_info_type->data.x_type, false);
fields[3].data.x_ptr.special = ConstPtrSpecialRef;
fields[3].data.x_ptr.mut = ConstPtrMutComptimeVar;
- fields[3].data.x_ptr.data.ref.pointee = ir_make_type_info_value(ira, &fields[3], type_entry->data.pointer.child_type);
+ ConstExprValue *union_val = create_const_vals(1);
+ union_val->type = type_info_type->data.x_type;
+ bigint_init_unsigned(&union_val->data.x_union.tag, type_id_index(type_entry->data.pointer.child_type->id));
+ union_val->data.x_union.payload = ir_make_type_info_value(ira, union_val, type_entry->data.pointer.child_type);
+ fields[3].data.x_ptr.data.ref.pointee = union_val;
return payload;
}
default: