diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-02-24 22:56:34 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-02-24 22:56:34 +0000 |
| commit | 67ed8a9a4ab8fdcfc77036c827b7dfa98025bc8b (patch) | |
| tree | 08458a0213210863eab89a468f8ee119f48787f0 /src | |
| parent | 4cc4d604bcfb34a23272e8c467c16be2fc17d523 (diff) | |
Fix Tuple type info bug
Caused by not having type safe tagged unions :P (Silly C)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ir.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -6504,10 +6504,10 @@ void ir_gen_tree(irGen *s) { irValue *variadic = ir_emit_struct_ep(proc, tag, 2); irValue *convention = ir_emit_struct_ep(proc, tag, 3); - if (t->Proc.params) { + if (t->Proc.params != NULL) { ir_emit_store(proc, params, ir_get_type_info_ptr(proc, t->Proc.params)); } - if (t->Proc.results) { + if (t->Proc.results != NULL) { ir_emit_store(proc, results, ir_get_type_info_ptr(proc, t->Proc.results)); } ir_emit_store(proc, variadic, ir_make_const_bool(a, t->Proc.variadic)); @@ -6525,8 +6525,8 @@ void ir_gen_tree(irGen *s) { ir_emit_store(proc, ir_emit_struct_ep(proc, record, 4), align); } - irValue *memory_types = ir_type_info_member_types_offset(proc, t->Record.field_count); - irValue *memory_names = ir_type_info_member_names_offset(proc, t->Record.field_count); + irValue *memory_types = ir_type_info_member_types_offset(proc, t->Tuple.variable_count); + irValue *memory_names = ir_type_info_member_names_offset(proc, t->Tuple.variable_count); for (isize i = 0; i < t->Tuple.variable_count; i++) { // NOTE(bill): offset is not used for tuples @@ -6542,8 +6542,8 @@ void ir_gen_tree(irGen *s) { } } - ir_fill_slice(proc, ir_emit_struct_ep(proc, record, 0), memory_types, ir_make_const_int(a, t->Record.field_count)); - ir_fill_slice(proc, ir_emit_struct_ep(proc, record, 1), memory_names, ir_make_const_int(a, t->Record.field_count)); + ir_fill_slice(proc, ir_emit_struct_ep(proc, record, 0), memory_types, ir_make_const_int(a, t->Tuple.variable_count)); + ir_fill_slice(proc, ir_emit_struct_ep(proc, record, 1), memory_names, ir_make_const_int(a, t->Tuple.variable_count)); } break; case Type_Record: { switch (t->Record.kind) { |