diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-08-22 12:55:09 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-08-22 12:56:35 -0400 |
| commit | 0d6a6c76eabcd020c5f58dc4667766b0e2756dfa (patch) | |
| tree | fbdea15f00c303d136f38bfc9025baa736251227 /src/ir.cpp | |
| parent | 8460d5617cc12d614abf39f55ab85c783c4b35a8 (diff) | |
| download | zig-0d6a6c76eabcd020c5f58dc4667766b0e2756dfa.tar.gz zig-0d6a6c76eabcd020c5f58dc4667766b0e2756dfa.zip | |
add missing "referenced here" notes for lazy values
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 7 |
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; |
