From 057a5d4898f70c6a8169c99375fbb8631e539051 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 14 May 2019 21:21:59 -0400 Subject: slice types no longer have field access * fix crash when doing field access of slice types. closes #2486 * remove the deprecated Child property from slice types * add -Dskip-non-native build option to build script --- src/ir.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index afdbc16b5f..f70d5d475c 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -16178,18 +16178,7 @@ static IrInstruction *ir_analyze_instruction_field_ptr(IrAnalyze *ira, IrInstruc if (type_is_invalid(child_type)) { return ira->codegen->invalid_instruction; - } else if (is_container(child_type)) { - if (is_slice(child_type) && buf_eql_str(field_name, "Child")) { - bool ptr_is_const = true; - bool ptr_is_volatile = false; - TypeStructField *ptr_field = &child_type->data.structure.fields[slice_ptr_index]; - assert(ptr_field->type_entry->id == ZigTypeIdPointer); - ZigType *child_type = ptr_field->type_entry->data.pointer.child_type; - return ir_get_const_ptr(ira, &field_ptr_instruction->base, - create_const_type(ira->codegen, child_type), - ira->codegen->builtin_types.entry_type, - ConstPtrMutComptimeConst, ptr_is_const, ptr_is_volatile, 0); - } + } else if (is_container(child_type) && !is_slice(child_type)) { if (child_type->id == ZigTypeIdEnum) { if ((err = ensure_complete_type(ira->codegen, child_type))) return ira->codegen->invalid_instruction; -- cgit v1.2.3