mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-04 02:40:53 +01:00
Fix segfault in loadDefinition
for unit tests (#705)
`module` can be empty if the definition file has syntax errors
This commit is contained in:
parent
d6aa35583e
commit
ff736fd3e4
1 changed files with 2 additions and 1 deletions
|
@ -429,7 +429,8 @@ LoadDefinitionFileResult Fixture::loadDefinition(const std::string& source)
|
||||||
LoadDefinitionFileResult result = frontend.loadDefinitionFile(source, "@test");
|
LoadDefinitionFileResult result = frontend.loadDefinitionFile(source, "@test");
|
||||||
freeze(typeChecker.globalTypes);
|
freeze(typeChecker.globalTypes);
|
||||||
|
|
||||||
dumpErrors(result.module);
|
if (result.module)
|
||||||
|
dumpErrors(result.module);
|
||||||
REQUIRE_MESSAGE(result.success, "loadDefinition: unable to load definition file");
|
REQUIRE_MESSAGE(result.success, "loadDefinition: unable to load definition file");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue