aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-02-07 16:31:52 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-02-07 16:31:52 -0500
commit39ee1f4b97053cdc080ddf3562cefc6bed2071a8 (patch)
treec83df676c1bcb69d576a6788aa706573aab3d14c /src/analyze.cpp
parent4a606893097748123c053a2df329e70050a70487 (diff)
downloadzig-39ee1f4b97053cdc080ddf3562cefc6bed2071a8.tar.gz
zig-39ee1f4b97053cdc080ddf3562cefc6bed2071a8.zip
fix invalid behavior tests from prev commit
and fix "no-op casts" from incorrectly spilling
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 155f017da9..70352a2c18 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -6369,6 +6369,12 @@ static Error resolve_async_frame(CodeGen *g, ZigType *frame_type) {
// This instruction does its own spilling specially, or otherwise doesn't need it.
continue;
}
+ if (instruction->id == IrInstGenIdCast &&
+ reinterpret_cast<IrInstGenCast *>(instruction)->cast_op == CastOpNoop)
+ {
+ // The IR instruction exists only to change the type according to Zig. No spill needed.
+ continue;
+ }
if (instruction->value->special != ConstValSpecialRuntime)
continue;
if (instruction->base.ref_count == 0)