aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-11-12 12:21:20 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-11-12 12:21:20 -0500
commit710ccacfa3307fc642f4bac71f894e3d8a18764a (patch)
tree1009192df70245ed9b652dedb23d064c2473c7d5 /src/ir.cpp
parent45d2fd9b9d86c4a5751612f62aa324d635976bf8 (diff)
downloadzig-710ccacfa3307fc642f4bac71f894e3d8a18764a.tar.gz
zig-710ccacfa3307fc642f4bac71f894e3d8a18764a.zip
fix assertion failure in ptrToInt
found by building pluto
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 9d15e341da..f193f5d0b9 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -25394,6 +25394,7 @@ static IrInstruction *ir_analyze_instruction_decl_ref(IrAnalyze *ira,
}
static IrInstruction *ir_analyze_instruction_ptr_to_int(IrAnalyze *ira, IrInstructionPtrToInt *instruction) {
+ Error err;
IrInstruction *target = instruction->target->child;
if (type_is_invalid(target->value.type))
return ira->codegen->invalid_instruction;
@@ -25407,6 +25408,8 @@ static IrInstruction *ir_analyze_instruction_ptr_to_int(IrAnalyze *ira, IrInstru
return ira->codegen->invalid_instruction;
}
+ if ((err = type_resolve(ira->codegen, target->value.type, ResolveStatusZeroBitsKnown)))
+ return ira->codegen->invalid_instruction;
if (!type_has_bits(target->value.type)) {
ir_add_error(ira, target,
buf_sprintf("pointer to size 0 type has no address"));