Sema: add reference trace before checking for cached value

Closes #13143
This commit is contained in:
Veikka Tuominen
2022-10-12 18:52:51 +03:00
parent 3a8777a8bb
commit 260b0ff7c5

View File

@@ -26792,10 +26792,10 @@ fn analyzeDeclVal(
src: LazySrcLoc,
decl_index: Decl.Index,
) CompileError!Air.Inst.Ref {
try sema.addReferencedBy(block, src, decl_index);
if (sema.decl_val_table.get(decl_index)) |result| {
return result;
}
try sema.addReferencedBy(block, src, decl_index);
const decl_ref = try sema.analyzeDeclRef(decl_index);
const result = try sema.analyzeLoad(block, src, decl_ref, src);
if (Air.refToIndex(result)) |index| {