aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 9c9a28ee56..e64098be01 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -10813,8 +10813,13 @@ ConstExprValue *ir_eval_const_value(CodeGen *codegen, Scope *scope, AstNode *nod
ConstExprValue *result = ir_exec_const_result(codegen, analyzed_executable);
if (!allow_lazy) {
- if ((err = ir_resolve_lazy(codegen, node, result)))
+ if ((err = ir_resolve_lazy(codegen, node, result))) {
+ if (codegen->trace_err != nullptr) {
+ codegen->trace_err = add_error_note(codegen, codegen->trace_err, source_node,
+ buf_create_from_str("referenced here"));
+ }
return &codegen->invalid_instruction->value;
+ }
}
return result;