Parser error for wrong number of datatypes (#5049)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Thu, 10 Sep 2020 03:34:36 +0000 (22:34 -0500)
committerGitHub <noreply@github.com>
Thu, 10 Sep 2020 03:34:36 +0000 (22:34 -0500)
Fixes #4973.

src/parser/smt2/Smt2.g

index 4bb253603bfff3543ca6a8b39f824e4aaea056c6..ea0c3b71431266c0f254ce75e9af24302eeade0d 100644 (file)
@@ -1265,6 +1265,10 @@ datatypesDef[bool isCo,
     RPAREN_TOK
     )+
   {
+    if (dts.size() != dnames.size())
+    {
+      PARSER_STATE->parseError("Wrong number of datatypes provided.");
+    }
     PARSER_STATE->popScope();
     cmd->reset(new DatatypeDeclarationCommand(
       api::sortVectorToTypes(