aboutsummaryrefslogtreecommitdiff
path: root/src/AstGen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-09-30 00:14:55 -0400
committerGitHub <noreply@github.com>2022-09-30 00:14:55 -0400
commit34835bbbcfe81cc87e823d14dc9b25e698ad5edc (patch)
tree28a56101f900d2b5a098b78ee800f4df909ae577 /src/AstGen.zig
parentf6312e4b6933b8c8d163d6e6b20da135c5fa986a (diff)
parent2a4e89e0c9428b1ca59bc23c7c1d667c8ddb2304 (diff)
downloadzig-34835bbbcfe81cc87e823d14dc9b25e698ad5edc.tar.gz
zig-34835bbbcfe81cc87e823d14dc9b25e698ad5edc.zip
Merge pull request #13010 from Vexu/stage2-fixes
fix stack trace line numbers
Diffstat (limited to 'src/AstGen.zig')
-rw-r--r--src/AstGen.zig11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/AstGen.zig b/src/AstGen.zig
index 8e6721d7bc..422827c673 100644
--- a/src/AstGen.zig
+++ b/src/AstGen.zig
@@ -4233,13 +4233,10 @@ fn structDeclInner(
// are in scope, so that field types, alignments, and default value expressions
// can refer to decls within the struct itself.
astgen.advanceSourceCursorToNode(node);
- // If `node == 0` then this is the root struct and all the declarations should
- // be relative to the beginning of the file.
- const decl_line = if (node == 0) 0 else astgen.source_line;
var block_scope: GenZir = .{
.parent = &namespace.base,
.decl_node_index = node,
- .decl_line = decl_line,
+ .decl_line = gz.decl_line,
.astgen = astgen,
.force_comptime = true,
.instructions = gz.instructions,
@@ -4439,7 +4436,7 @@ fn unionDeclInner(
var block_scope: GenZir = .{
.parent = &namespace.base,
.decl_node_index = node,
- .decl_line = astgen.source_line,
+ .decl_line = gz.decl_line,
.astgen = astgen,
.force_comptime = true,
.instructions = gz.instructions,
@@ -4722,7 +4719,7 @@ fn containerDecl(
var block_scope: GenZir = .{
.parent = &namespace.base,
.decl_node_index = node,
- .decl_line = astgen.source_line,
+ .decl_line = gz.decl_line,
.astgen = astgen,
.force_comptime = true,
.instructions = gz.instructions,
@@ -4827,7 +4824,7 @@ fn containerDecl(
var block_scope: GenZir = .{
.parent = &namespace.base,
.decl_node_index = node,
- .decl_line = astgen.source_line,
+ .decl_line = gz.decl_line,
.astgen = astgen,
.force_comptime = true,
.instructions = gz.instructions,