aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-08-30 04:14:53 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-08-30 04:23:52 -0400
commit3f5dd08ca8010ef365b6cf203214aac353c36643 (patch)
treed003f65d514d253854f7371cb3536c0cb9301156 /src/ir.cpp
parent849f65332d52aa315093318a1851d8207f2a290e (diff)
downloadzig-3f5dd08ca8010ef365b6cf203214aac353c36643.tar.gz
zig-3f5dd08ca8010ef365b6cf203214aac353c36643.zip
codegen: all stores specify align value
See #37
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index fb485ede98..f37194a557 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -14175,7 +14175,15 @@ static TypeTableEntry *ir_analyze_instruction_overflow_op(IrAnalyze *ira, IrInst
if (type_is_invalid(result_ptr->value.type))
return ira->codegen->builtin_types.entry_invalid;
- TypeTableEntry *expected_ptr_type = get_pointer_to_type(ira->codegen, dest_type, false);
+ TypeTableEntry *expected_ptr_type;
+ if (result_ptr->value.type->id == TypeTableEntryIdPointer) {
+ expected_ptr_type = get_pointer_to_type_extra(ira->codegen, dest_type,
+ false, result_ptr->value.type->data.pointer.is_volatile,
+ result_ptr->value.type->data.pointer.alignment, 0, 0);
+ } else {
+ expected_ptr_type = get_pointer_to_type(ira->codegen, dest_type, false);
+ }
+
IrInstruction *casted_result_ptr = ir_implicit_cast(ira, result_ptr, expected_ptr_type);
if (type_is_invalid(casted_result_ptr->value.type))
return ira->codegen->builtin_types.entry_invalid;