authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-11-12 12:21:20-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-11-12 12:21:20-05:00
log710ccacfa3307fc642f4bac71f894e3d8a18764a
tree1009192df70245ed9b652dedb23d064c2473c7d5
parent45d2fd9b9d86c4a5751612f62aa324d635976bf8
signaturelock-open Commit is signed but in an unrecognized format.

fix assertion failure in ptrToInt

found by building pluto

1 files changed, 3 insertions(+), 0 deletions(-)

src/ir.cpp+3
...@@ -25394,6 +25394,7 @@ static IrInstruction *ir_analyze_instruction_decl_ref(IrAnalyze *ira,...@@ -25394,6 +25394,7 @@ static IrInstruction *ir_analyze_instruction_decl_ref(IrAnalyze *ira,
25394}25394}
2539525395
25396static IrInstruction *ir_analyze_instruction_ptr_to_int(IrAnalyze *ira, IrInstructionPtrToInt *instruction) {25396static IrInstruction *ir_analyze_instruction_ptr_to_int(IrAnalyze *ira, IrInstructionPtrToInt *instruction) {
25397 Error err;
25397 IrInstruction *target = instruction->target->child;25398 IrInstruction *target = instruction->target->child;
25398 if (type_is_invalid(target->value.type))25399 if (type_is_invalid(target->value.type))
25399 return ira->codegen->invalid_instruction;25400 return ira->codegen->invalid_instruction;
...@@ -25407,6 +25408,8 @@ static IrInstruction *ir_analyze_instruction_ptr_to_int(IrAnalyze *ira, IrInstru...@@ -25407,6 +25408,8 @@ static IrInstruction *ir_analyze_instruction_ptr_to_int(IrAnalyze *ira, IrInstru
25407 return ira->codegen->invalid_instruction;25408 return ira->codegen->invalid_instruction;
25408 }25409 }
2540925410
25411 if ((err = type_resolve(ira->codegen, target->value.type, ResolveStatusZeroBitsKnown)))
25412 return ira->codegen->invalid_instruction;
25410 if (!type_has_bits(target->value.type)) {25413 if (!type_has_bits(target->value.type)) {
25411 ir_add_error(ira, target,25414 ir_add_error(ira, target,
25412 buf_sprintf("pointer to size 0 type has no address"));25415 buf_sprintf("pointer to size 0 type has no address"));