aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-08-23 17:39:56 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-08-23 17:39:56 -0400
commite8bad1e12a972ce26aeedd37bf49a6751bab2b76 (patch)
tree97e3a45b53038ec672cebe6ded341517fcd93256 /src/ir.cpp
parent101440c1990de653bbfb19713915d86d7a5bc182 (diff)
downloadzig-e8bad1e12a972ce26aeedd37bf49a6751bab2b76.tar.gz
zig-e8bad1e12a972ce26aeedd37bf49a6751bab2b76.zip
fix regression on `@ptrCast`
this case regressed and now fixed: ```zig const a: ?*i32 = undefined; const b: ?*f32 = @ptrCast(?*f32, a); ```
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 2f38b42221..558dbca265 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -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);