diff options
| author | LemonBoy <thatlemon@gmail.com> | 2020-03-23 10:00:46 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-03-23 09:13:52 -0400 |
| commit | 0cd953d40ea0f6934a0900f7ad8593e5deaf6efd (patch) | |
| tree | b594359b1f26078553200d6510e983f3a859243a /src/ir.cpp | |
| parent | 13d04f9963be930360ab728edd47f1a6ecfb1777 (diff) | |
| download | zig-0cd953d40ea0f6934a0900f7ad8593e5deaf6efd.tar.gz zig-0cd953d40ea0f6934a0900f7ad8593e5deaf6efd.zip | |
ir: Prevent crash when slicing hardcoded pointer
Closes #4780
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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; |
