mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 21:38:33 +00:00
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:
parent
101440c199
commit
e8bad1e12a
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user