aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-11-12 21:34:06 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-11-12 21:57:25 -0500
commit32b37e695aa0581b863a395e0a28b7b4aa76c07d (patch)
tree6c942241282c9c1163bb22b75f91efda49712291 /src/codegen.cpp
parent37318bf15138d0a7b158b32ca43cbcdcf5382942 (diff)
downloadzig-32b37e695aa0581b863a395e0a28b7b4aa76c07d.tar.gz
zig-32b37e695aa0581b863a395e0a28b7b4aa76c07d.zip
fix anonymous struct literal assigned to variable
closes #3667
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 558a7011f0..387c6120c2 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -3622,9 +3622,14 @@ static void gen_undef_init(CodeGen *g, uint32_t ptr_align_bytes, ZigType *value_
}
static LLVMValueRef ir_render_store_ptr(CodeGen *g, IrExecutable *executable, IrInstructionStorePtr *instruction) {
+ Error err;
+
ZigType *ptr_type = instruction->ptr->value.type;
assert(ptr_type->id == ZigTypeIdPointer);
- if (!type_has_bits(ptr_type))
+ bool ptr_type_has_bits;
+ if ((err = type_has_bits2(g, ptr_type, &ptr_type_has_bits)))
+ codegen_report_errors_and_exit(g);
+ if (!ptr_type_has_bits)
return nullptr;
if (instruction->ptr->ref_count == 0) {
// In this case, this StorePtr instruction should be elided. Something happened like this: