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.
This commit is contained in:
Andrew Kelley
2023-12-28 17:42:23 -07:00
parent 8fa4496909
commit 196ddf010c
2 changed files with 4 additions and 1 deletions

View File

@@ -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);