aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-05-07 18:09:45 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-05-07 18:09:45 -0400
commite485af94d404792f7f695fcbc7ee8f9fb986291b (patch)
tree0e9f802efb0b6f300d411fa55f9a1ef66c9fb75e /src/ir.cpp
parentb7579f5f7d4f3295187f7901d97361a63a484d77 (diff)
downloadzig-e485af94d404792f7f695fcbc7ee8f9fb986291b.tar.gz
zig-e485af94d404792f7f695fcbc7ee8f9fb986291b.zip
fix inability to initialize global pointer to global array element
closes #366
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 53f2a48d74..e91a1aad49 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -9753,7 +9753,7 @@ static TypeTableEntry *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstruc
ConstExprValue *array_ptr_val;
if (array_ptr->value.special != ConstValSpecialRuntime &&
- array_ptr->value.data.x_ptr.mut != ConstPtrMutRuntimeVar &&
+ (array_ptr->value.data.x_ptr.mut != ConstPtrMutRuntimeVar || array_type->id == TypeTableEntryIdArray) &&
(array_ptr_val = const_ptr_pointee(ira->codegen, &array_ptr->value)) &&
array_ptr_val->special != ConstValSpecialRuntime &&
(array_type->id != TypeTableEntryIdPointer ||