aboutsummaryrefslogtreecommitdiff
path: root/src/Package/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/Package/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/Package/Module.zig')
-rw-r--r--src/Package/Module.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Package/Module.zig b/src/Package/Module.zig
index 3c3a1c81e6..66d5a21eab 100644
--- a/src/Package/Module.zig
+++ b/src/Package/Module.zig
@@ -466,6 +466,9 @@ pub fn createLimited(gpa: Allocator, options: LimitedOptions) Allocator.Error!*P
return mod;
}
+/// Asserts that the module has a builtin module, which is not true for non-zig
+/// modules such as ones only used for `@embedFile`, or the root module when
+/// there is no Zig Compilation Unit.
pub fn getBuiltinDependency(m: Module) *Module {
const result = m.deps.values()[0];
assert(result.isBuiltin());