| ... | ... | @@ -155,18 +155,22 @@ static TypeTableEntry *adjust_slice_align(CodeGen *g, TypeTableEntry *slice_type |
| 155 | 155 | ConstExprValue *const_ptr_pointee(CodeGen *g, ConstExprValue *const_val) { |
| 156 | 156 | assert(get_codegen_ptr_type(const_val->type) != nullptr); |
| 157 | 157 | assert(const_val->special == ConstValSpecialStatic); |
| 158 | ConstExprValue *result; |
| 158 | 159 | switch (const_val->data.x_ptr.special) { |
| 159 | 160 | case ConstPtrSpecialInvalid: |
| 160 | 161 | zig_unreachable(); |
| 161 | 162 | case ConstPtrSpecialRef: |
| 162 | | return const_val->data.x_ptr.data.ref.pointee; |
| 163 | result = const_val->data.x_ptr.data.ref.pointee; |
| 164 | break; |
| 163 | 165 | case ConstPtrSpecialBaseArray: |
| 164 | 166 | expand_undef_array(g, const_val->data.x_ptr.data.base_array.array_val); |
| 165 | | return &const_val->data.x_ptr.data.base_array.array_val->data.x_array.s_none.elements[ |
| 167 | result = &const_val->data.x_ptr.data.base_array.array_val->data.x_array.s_none.elements[ |
| 166 | 168 | const_val->data.x_ptr.data.base_array.elem_index]; |
| 169 | break; |
| 167 | 170 | case ConstPtrSpecialBaseStruct: |
| 168 | | return &const_val->data.x_ptr.data.base_struct.struct_val->data.x_struct.fields[ |
| 171 | result = &const_val->data.x_ptr.data.base_struct.struct_val->data.x_struct.fields[ |
| 169 | 172 | const_val->data.x_ptr.data.base_struct.field_index]; |
| 173 | break; |
| 170 | 174 | case ConstPtrSpecialHardCodedAddr: |
| 171 | 175 | zig_unreachable(); |
| 172 | 176 | case ConstPtrSpecialDiscard: |
| ... | ... | @@ -174,7 +178,8 @@ ConstExprValue *const_ptr_pointee(CodeGen *g, ConstExprValue *const_val) { |
| 174 | 178 | case ConstPtrSpecialFunction: |
| 175 | 179 | zig_unreachable(); |
| 176 | 180 | } |
| 177 | | zig_unreachable(); |
| 181 | assert(result != nullptr); |
| 182 | return result; |
| 178 | 183 | } |
| 179 | 184 | |
| 180 | 185 | static bool ir_should_inline(IrExecutable *exec, Scope *scope) { |