aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-12-28 17:42:23 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-01-01 19:49:08 -0700
commit196ddf010c97f2faf69513e61099a233d4270795 (patch)
tree14a3e4630e0cba5cab0434b7717bea092b5123c4 /src/Module.zig
parent8fa44969095caa293cb76b9a0b5fc0c0c270dc3b (diff)
downloadzig-196ddf010c97f2faf69513e61099a233d4270795.tar.gz
zig-196ddf010c97f2faf69513e61099a233d4270795.zip
frontend: fix populateTestFunctions accessing the wrong module
The test runner reads the list of test function pointers from its own builtin module, which is the root_mod, not main_mod.
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 558c03d685..9d3810f671 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -5307,7 +5307,7 @@ pub fn populateTestFunctions(
) !void {
const gpa = mod.gpa;
const ip = &mod.intern_pool;
- const builtin_mod = mod.main_mod.getBuiltinDependency();
+ const builtin_mod = mod.root_mod.getBuiltinDependency();
const builtin_file = (mod.importPkg(builtin_mod) catch unreachable).file;
const root_decl = mod.declPtr(builtin_file.root_decl.unwrap().?);
const builtin_namespace = mod.namespacePtr(root_decl.src_namespace);