aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2025-02-05 19:08:05 +0000
committermlugg <mlugg@mlugg.co.uk>2025-02-05 19:08:05 +0000
commit456f3c026b3d6fb289f42e442b202e0be152c9d3 (patch)
tree49510e75264bff79e08b4539f34843624816a365 /src
parent3ce857d0543780e96bfd50d75d53d870ff308fef (diff)
downloadzig-456f3c026b3d6fb289f42e442b202e0be152c9d3.tar.gz
zig-456f3c026b3d6fb289f42e442b202e0be152c9d3.zip
Sema: fix crash on `@tagName` of undefined enum literal
Resolves: #20826
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 ad144bf013..af077c5150 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -21401,7 +21401,7 @@ fn zirTagName(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
try operand_ty.resolveLayout(pt);
const enum_ty = switch (operand_ty.zigTypeTag(zcu)) {
.enum_literal => {
- const val = try sema.resolveConstDefinedValue(block, LazySrcLoc.unneeded, operand, undefined);
+ const val = (try sema.resolveDefinedValue(block, operand_src, operand)).?;
const tag_name = ip.indexToKey(val.toIntern()).enum_literal;
return sema.addNullTerminatedStrLit(tag_name);
},