fix inability to initialize global pointer to global array element

closes #366
This commit is contained in:
Andrew Kelley
2017-05-07 18:09:45 -04:00
parent b7579f5f7d
commit e485af94d4
2 changed files with 54 additions and 41 deletions

View File

@@ -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 ||