diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-05-14 21:21:59 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-05-14 21:21:59 -0400 |
| commit | 057a5d4898f70c6a8169c99375fbb8631e539051 (patch) | |
| tree | 92484c1a4c095811ddea19032e85fde82582f600 /src/ir.cpp | |
| parent | 5a57610039b6150557b159fe9a8eb30088455dba (diff) | |
| download | zig-057a5d4898f70c6a8169c99375fbb8631e539051.tar.gz zig-057a5d4898f70c6a8169c99375fbb8631e539051.zip | |
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
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
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; |
