fix regression on @ptrCast

this case regressed and now fixed:

```zig
const a: ?*i32 = undefined;
const b: ?*f32 = @ptrCast(?*f32, a);
```
This commit is contained in:
Andrew Kelley 2019-08-23 17:39:56 -04:00
parent 101440c199
commit e8bad1e12a
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -23298,12 +23298,7 @@ static IrInstruction *ir_analyze_ptr_cast(IrAnalyze *ira, IrInstruction *source_
if (!val)
return ira->codegen->invalid_instruction;
if (value_is_comptime(val)) {
if ((err = ir_resolve_const_val(ira->codegen, ira->new_irb.exec,
source_instr->source_node, val, UndefBad)))
{
return ira->codegen->invalid_instruction;
}
if (value_is_comptime(val) && val->special != ConstValSpecialUndef) {
bool is_addr_zero = val->data.x_ptr.special == ConstPtrSpecialNull ||
(val->data.x_ptr.special == ConstPtrSpecialHardCodedAddr &&
val->data.x_ptr.data.hard_coded_addr.addr == 0);