Skip to content
Snippets Groups Projects
Commit 367a8eb8 authored by Markus Alexander Kuppe's avatar Markus Alexander Kuppe
Browse files

Gracefully handle module lookup failure instead of throwing a NPE.

TLC threw an unexpected exception.
This was probably caused by an error in the spec or model.
See the User Output or TLC Console for clues to what happened.
The exception was a java.lang.NullPointerException
java.lang.NullPointerException
at tlc2.tool.impl.SpecProcessor.processSpec(SpecProcessor.java:359)
at tlc2.tool.impl.SpecProcessor.<init>(SpecProcessor.java:162)
at tlc2.tool.impl.Spec.<init>(Spec.java:96)
at tlc2.tool.impl.Tool.<init>(Tool.java:124)
at tlc2.tool.impl.Tool.<init>(Tool.java:119)
at tlc2.tool.impl.Tool.<init>(Tool.java:114)
at tlc2.tool.impl.FastTool.<init>(FastTool.java:47)
at tlc2.TLC.process(TLC.java:1045)
at tlc2.TLC.main(TLC.java:287)

[Bug][TLC]
parent aa8de3ed
No related branches found
No related tags found
No related merge requests found
......@@ -355,6 +355,10 @@ public class SpecProcessor implements ValueConstants, ToolGlobals {
UniqueString rootName = UniqueString.uniqueStringOf(this.rootFile);
this.rootModule = this.moduleTbl.getModuleNode(rootName);
Assert.check(this.rootModule != null, EC.TLC_PARSING_FAILED2,
String.format(" Module-Table lookup failure for module name %s derived from %s file name.",
rootName.toString(), this.rootFile));
// Get all the state variables in the spec:
OpDeclNode[] varDecls = this.rootModule.getVariableDecls();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment