authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-18 10:49:21-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-18 10:49:21-04:00
logfdc6e0af056e72ee47a296e7d8fbb365dc00c058
tree50226b0ba024289d6c1eccee5c014e29c1009509
parente5a0414b05134bfebba4fba097ae882ee0cf36cf
signaturelock-open Commit is signed but in an unrecognized format.

fix zero length array literal casted to slice


1 files changed, 14 insertions(+), 2 deletions(-)

src/ir.cpp+14-2
......@@ -15119,8 +15119,11 @@ static IrInstruction *ir_analyze_instruction_resolve_result(IrAnalyze *ira, IrIn
1511915119 old_result_loc = reinterpret_cast<ResultLocPeer *>(instruction->result_loc)->parent->parent;
1512015120 continue;
1512115121 }
15122 ir_assert(false, &instruction->base); // TODO
15123 zig_unreachable();
15122 IrInstruction *result = ir_const(ira, &instruction->base, implicit_elem_type);
15123 result->value.special = ConstValSpecialUndef;
15124 IrInstruction *ptr = ir_get_ref(ira, &instruction->base, result, false, false);
15125 ptr->value.data.x_ptr.mut = ConstPtrMutComptimeVar;
15126 return ptr;
1512415127 }
1512515128}
1512615129
......@@ -19212,6 +19215,15 @@ static IrInstruction *ir_analyze_instruction_container_init_list(IrAnalyze *ira,
1921219215 return ira->codegen->invalid_instruction;
1921319216 }
1921419217
19218 switch (type_has_one_possible_value(ira->codegen, container_type)) {
19219 case OnePossibleValueInvalid:
19220 return ira->codegen->invalid_instruction;
19221 case OnePossibleValueYes:
19222 return ir_const(ira, &instruction->base, container_type);
19223 case OnePossibleValueNo:
19224 break;
19225 }
19226
1921519227 bool is_comptime;
1921619228 switch (type_requires_comptime(ira->codegen, container_type)) {
1921719229 case ReqCompTimeInvalid: