From 0cd953d40ea0f6934a0900f7ad8593e5deaf6efd Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Mon, 23 Mar 2020 10:00:46 +0100 Subject: ir: Prevent crash when slicing hardcoded pointer Closes #4780 --- src/ir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index b64128bef9..f0f0930762 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -12819,7 +12819,7 @@ static IrInstGen *ir_resolve_ptr_of_array_to_slice(IrAnalyze *ira, IrInst* sourc result->value->type = wanted_type; return result; } - } else { + } else if (array_ptr_val->data.x_ptr.special != ConstPtrSpecialHardCodedAddr) { ZigValue *pointee = const_ptr_pointee(ira, ira->codegen, array_ptr_val, source_instr->source_node); if (pointee == nullptr) return ira->codegen->invalid_inst_gen; -- cgit v1.2.3