| author | |
| committer | |
| log | fb8da16a60e13b09c5c6bb4989c204da536597b7 |
| tree | 402dfa141101fb7ea1bdd24c198070501a0ad178 |
| parent | d0b055d69e44848cf602a1ce8709ed568728a822 |
| signature | Commit is signed but in an unrecognized format. |
3 files changed, 9 insertions(+), 8 deletions(-)
src/ir.cpp+4-4| ... | @@ -17918,6 +17918,9 @@ static IrInstruction *ir_get_var_ptr(IrAnalyze *ira, IrInstruction *instruction, | ... | @@ -17918,6 +17918,9 @@ static IrInstruction *ir_get_var_ptr(IrAnalyze *ira, IrInstruction *instruction, |
| 17918 | var = var->next_var; | 17918 | var = var->next_var; |
| 17919 | } | 17919 | } |
| 17920 | 17920 | ||
| 17921 | if (var->var_type == nullptr || type_is_invalid(var->var_type)) | ||
| 17922 | return ira->codegen->invalid_instruction; | ||
| 17923 | |||
| 17921 | bool is_volatile = false; | 17924 | bool is_volatile = false; |
| 17922 | ZigType *var_ptr_type = get_pointer_to_type_extra(ira->codegen, var->var_type, | 17925 | ZigType *var_ptr_type = get_pointer_to_type_extra(ira->codegen, var->var_type, |
| 17923 | var->src_is_const, is_volatile, PtrLenSingle, var->align_bytes, 0, 0, false); | 17926 | var->src_is_const, is_volatile, PtrLenSingle, var->align_bytes, 0, 0, false); |
| ... | @@ -17926,9 +17929,6 @@ static IrInstruction *ir_get_var_ptr(IrAnalyze *ira, IrInstruction *instruction, | ... | @@ -17926,9 +17929,6 @@ static IrInstruction *ir_get_var_ptr(IrAnalyze *ira, IrInstruction *instruction, |
| 17926 | return ir_implicit_cast(ira, var->ptr_instruction, var_ptr_type); | 17929 | return ir_implicit_cast(ira, var->ptr_instruction, var_ptr_type); |
| 17927 | } | 17930 | } |
| 17928 | 17931 | ||
| 17929 | if (var->var_type == nullptr || type_is_invalid(var->var_type)) | ||
| 17930 | return ira->codegen->invalid_instruction; | ||
| 17931 | |||
| 17932 | ZigValue *mem_slot = nullptr; | 17932 | ZigValue *mem_slot = nullptr; |
| 17933 | 17933 | ||
| 17934 | bool comptime_var_mem = ir_get_var_is_comptime(var); | 17934 | bool comptime_var_mem = ir_get_var_is_comptime(var); |
| ... | @@ -19761,7 +19761,7 @@ static IrInstruction *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstruct | ... | @@ -19761,7 +19761,7 @@ static IrInstruction *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstruct |
| 19761 | array_ptr_val->data.x_ptr.special != ConstPtrSpecialHardCodedAddr)) | 19761 | array_ptr_val->data.x_ptr.special != ConstPtrSpecialHardCodedAddr)) |
| 19762 | { | 19762 | { |
| 19763 | if ((err = ir_resolve_const_val(ira->codegen, ira->new_irb.exec, | 19763 | if ((err = ir_resolve_const_val(ira->codegen, ira->new_irb.exec, |
| 19764 | elem_ptr_instruction->base.source_node, array_ptr_val, UndefBad))) | 19764 | elem_ptr_instruction->base.source_node, array_ptr_val, UndefOk))) |
| 19765 | { | 19765 | { |
| 19766 | return ira->codegen->invalid_instruction; | 19766 | return ira->codegen->invalid_instruction; |
| 19767 | } | 19767 | } |
test/stage1/behavior.zig+2-2| ... | @@ -66,7 +66,7 @@ comptime { | ... | @@ -66,7 +66,7 @@ comptime { |
| 66 | _ = @import("behavior/fn.zig"); | 66 | _ = @import("behavior/fn.zig"); |
| 67 | _ = @import("behavior/fn_in_struct_in_comptime.zig"); | 67 | _ = @import("behavior/fn_in_struct_in_comptime.zig"); |
| 68 | _ = @import("behavior/fn_delegation.zig"); | 68 | _ = @import("behavior/fn_delegation.zig"); |
| 69 | //_ = @import("behavior/for.zig"); | 69 | _ = @import("behavior/for.zig"); |
| 70 | _ = @import("behavior/generics.zig"); | 70 | _ = @import("behavior/generics.zig"); |
| 71 | _ = @import("behavior/hasdecl.zig"); | 71 | _ = @import("behavior/hasdecl.zig"); |
| 72 | _ = @import("behavior/hasfield.zig"); | 72 | _ = @import("behavior/hasfield.zig"); |
| ... | @@ -107,7 +107,7 @@ comptime { | ... | @@ -107,7 +107,7 @@ comptime { |
| 107 | _ = @import("behavior/type.zig"); | 107 | _ = @import("behavior/type.zig"); |
| 108 | _ = @import("behavior/type_info.zig"); | 108 | _ = @import("behavior/type_info.zig"); |
| 109 | _ = @import("behavior/typename.zig"); | 109 | _ = @import("behavior/typename.zig"); |
| 110 | //_ = @import("behavior/undefined.zig"); | 110 | _ = @import("behavior/undefined.zig"); |
| 111 | _ = @import("behavior/underscore.zig"); | 111 | _ = @import("behavior/underscore.zig"); |
| 112 | _ = @import("behavior/union.zig"); | 112 | _ = @import("behavior/union.zig"); |
| 113 | _ = @import("behavior/usingnamespace.zig"); | 113 | _ = @import("behavior/usingnamespace.zig"); |
test/stage1/behavior/undefined.zig+3-2| ... | @@ -1,5 +1,6 @@ | ... | @@ -1,5 +1,6 @@ |
| 1 | const expect = @import("std").testing.expect; | 1 | const std = @import("std"); |
| 2 | const mem = @import("std").mem; | 2 | const expect = std.testing.expect; |
| 3 | const mem = std.mem; | ||
| 3 | 4 | ||
| 4 | fn initStaticArray() [10]i32 { | 5 | fn initStaticArray() [10]i32 { |
| 5 | var array: [10]i32 = undefined; | 6 | var array: [10]i32 = undefined; |