| ... | ... | @@ -26983,6 +26983,8 @@ static IrInstruction *ir_analyze_bit_cast(IrAnalyze *ira, IrInstruction *source_ |
| 26983 | 26983 | static IrInstruction *ir_analyze_int_to_ptr(IrAnalyze *ira, IrInstruction *source_instr, IrInstruction *target, |
| 26984 | 26984 | ZigType *ptr_type) |
| 26985 | 26985 | { |
| 26986 | Error err; |
| 26987 | |
| 26986 | 26988 | ir_assert(get_src_ptr_type(ptr_type) != nullptr, source_instr); |
| 26987 | 26989 | ir_assert(type_has_bits(ptr_type), source_instr); |
| 26988 | 26990 | |
| ... | ... | @@ -27002,7 +27004,10 @@ static IrInstruction *ir_analyze_int_to_ptr(IrAnalyze *ira, IrInstruction *sourc |
| 27002 | 27004 | return ira->codegen->invalid_instruction; |
| 27003 | 27005 | } |
| 27004 | 27006 | |
| 27005 | | const uint32_t align_bytes = get_ptr_align(ira->codegen, ptr_type); |
| 27007 | uint32_t align_bytes; |
| 27008 | if ((err = resolve_ptr_align(ira, ptr_type, &align_bytes))) |
| 27009 | return ira->codegen->invalid_instruction; |
| 27010 | |
| 27006 | 27011 | if (addr != 0 && addr % align_bytes != 0) { |
| 27007 | 27012 | ir_add_error(ira, source_instr, |
| 27008 | 27013 | buf_sprintf("pointer type '%s' requires aligned address", |