Skip to content

Commit

Permalink
Add missing @t param defence
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbattle committed Dec 2, 2023
1 parent 7ed4240 commit 14cd6fb
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions vdmj/src/main/java/com/fujitsu/vdmj/pog/ProofObligation.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,14 @@ private String launchExplicitFunction(POExplicitFunctionDefinition efd, Context

if (efd.typeParams != null)
{
callString.append(addTypeParams(efd.typeParams, ctxt));
String inst = addTypeParams(efd.typeParams, ctxt);

if (inst == null)
{
return null;
}

callString.append(inst);
}

for (POPatternList pl: efd.paramPatternList)
Expand Down Expand Up @@ -298,7 +305,14 @@ private String launchImplicitFunction(POImplicitFunctionDefinition ifd, Context

if (ifd.typeParams != null)
{
callString.append(addTypeParams(ifd.typeParams, ctxt));
String inst = addTypeParams(ifd.typeParams, ctxt);

if (inst == null)
{
return null;
}

callString.append(inst);
}

String sep = "";
Expand Down Expand Up @@ -336,6 +350,12 @@ private String addTypeParams(TCTypeList params, Context ctxt)
{
TCParameterType param = (TCParameterType)p;
ParameterValue inst = (ParameterValue) ctxt.get(param.name);

if (inst == null)
{
return null; // Missing type parameter?
}

callString.append(sep);
callString.append(inst.type);
sep = ", ";
Expand Down

0 comments on commit 14cd6fb

Please sign in to comment.