aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-11-24 22:04:24 -0500
committerAndrew Kelley <superjoe30@gmail.com>2017-11-24 22:04:24 -0500
commitcd36baf530d0c312884f485ed619438c1de91ef1 (patch)
treed4edc52c68f77f39fdd8adf545f61adfef2c39e0 /src/ir.cpp
parent40480c7cdc84697219e8b2434772709ad948ed4d (diff)
downloadzig-cd36baf530d0c312884f485ed619438c1de91ef1.tar.gz
zig-cd36baf530d0c312884f485ed619438c1de91ef1.zip
fix assertion failed when invalid type encountered
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index c81de7fa7a..35e6b3f8c6 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -7966,6 +7966,9 @@ static IrInstruction *ir_get_const_ptr(IrAnalyze *ira, IrInstruction *instructio
ConstExprValue *const_val = &const_instr->value;
const_val->type = pointee_type;
type_ensure_zero_bits_known(ira->codegen, type_entry);
+ if (type_is_invalid(type_entry)) {
+ return ira->codegen->invalid_instruction;
+ }
const_val->data.x_type = get_pointer_to_type_extra(ira->codegen, type_entry,
ptr_is_const, ptr_is_volatile, get_abi_alignment(ira->codegen, type_entry), 0, 0);
return const_instr;