| ... | ... | @@ -11528,7 +11528,13 @@ static bool optional_value_is_null(ConstExprValue *val) { |
| 11528 | 11528 | static ZigType *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp *bin_op_instruction) { |
| 11529 | 11529 | Error err; |
| 11530 | 11530 | IrInstruction *op1 = bin_op_instruction->op1->other; |
| 11531 | if (type_is_invalid(op1->value.type)) |
| 11532 | return ira->codegen->builtin_types.entry_invalid; |
| 11533 | |
| 11531 | 11534 | IrInstruction *op2 = bin_op_instruction->op2->other; |
| 11535 | if (type_is_invalid(op2->value.type)) |
| 11536 | return ira->codegen->builtin_types.entry_invalid; |
| 11537 | |
| 11532 | 11538 | AstNode *source_node = bin_op_instruction->base.source_node; |
| 11533 | 11539 | |
| 11534 | 11540 | IrBinOp op_id = bin_op_instruction->op_id; |
| ... | ... | @@ -20190,11 +20196,19 @@ static ZigType *ir_analyze_instruction_ptr_cast(IrAnalyze *ira, IrInstructionPtr |
| 20190 | 20196 | instruction->base.source_node, nullptr, ptr); |
| 20191 | 20197 | casted_ptr->value.type = dest_type; |
| 20192 | 20198 | |
| 20193 | | // Keep the bigger alignment, it can only help- |
| 20194 | | // unless the target is zero bits. |
| 20195 | | if ((err = type_resolve(ira->codegen, dest_type, ResolveStatusZeroBitsKnown))) |
| 20199 | if (type_has_bits(dest_type) && !type_has_bits(src_type)) { |
| 20200 | ErrorMsg *msg = ir_add_error(ira, &instruction->base, |
| 20201 | buf_sprintf("'%s' and '%s' do not have the same in-memory representation", |
| 20202 | buf_ptr(&src_type->name), buf_ptr(&dest_type->name))); |
| 20203 | add_error_note(ira->codegen, msg, ptr->source_node, |
| 20204 | buf_sprintf("'%s' has no in-memory bits", buf_ptr(&src_type->name))); |
| 20205 | add_error_note(ira->codegen, msg, dest_type_value->source_node, |
| 20206 | buf_sprintf("'%s' has in-memory bits", buf_ptr(&dest_type->name))); |
| 20196 | 20207 | return ira->codegen->builtin_types.entry_invalid; |
| 20208 | } |
| 20197 | 20209 | |
| 20210 | // Keep the bigger alignment, it can only help- |
| 20211 | // unless the target is zero bits. |
| 20198 | 20212 | IrInstruction *result; |
| 20199 | 20213 | if (src_align_bytes > dest_align_bytes && type_has_bits(dest_type)) { |
| 20200 | 20214 | result = ir_align_cast(ira, casted_ptr, src_align_bytes, false); |