aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-10-03 14:12:08 +0300
committerVeikka Tuominen <git@vexu.eu>2022-10-05 17:26:29 +0300
commitba4aa12098a0a9def52582cecd5b0b664ded14d8 (patch)
treefbb7caad7c97b10a7db6f07a7d76d1fd026390b8 /src
parent40578656e85a4bd930b03c143f179d43a925d151 (diff)
downloadzig-ba4aa12098a0a9def52582cecd5b0b664ded14d8.tar.gz
zig-ba4aa12098a0a9def52582cecd5b0b664ded14d8.zip
Sema: use correct value when `@ptrCast` operand is comptime known
Closes #13034
Diffstat (limited to 'src')
-rw-r--r--src/Sema.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 109b6f2a22..eb228c824e 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -18352,7 +18352,7 @@ fn zirPtrCast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
return sema.failWithOwnedErrorMsg(msg);
}
- if (try sema.resolveMaybeUndefVal(block, operand_src, operand)) |operand_val| {
+ if (try sema.resolveMaybeUndefVal(block, operand_src, ptr)) |operand_val| {
if (!dest_ty.ptrAllowsZero() and operand_val.isUndef()) {
return sema.failWithUseOfUndef(block, operand_src);
}