Skip to content

Commit

Permalink
Fix segfault in loadDefinition for unit tests (#705)
Browse files Browse the repository at this point in the history
`module` can be empty if the definition file has syntax errors
  • Loading branch information
JohnnyMorganz authored Oct 14, 2022
1 parent d6aa355 commit ff736fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/Fixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ LoadDefinitionFileResult Fixture::loadDefinition(const std::string& source)
LoadDefinitionFileResult result = frontend.loadDefinitionFile(source, "@test");
freeze(typeChecker.globalTypes);

dumpErrors(result.module);
if (result.module)
dumpErrors(result.module);
REQUIRE_MESSAGE(result.success, "loadDefinition: unable to load definition file");
return result;
}
Expand Down

0 comments on commit ff736fd

Please sign in to comment.