From b85ef5a122127f50b38380ec452023c26fdbbc66 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Wed, 9 Sep 2020 22:34:36 -0500 Subject: [PATCH] Parser error for wrong number of datatypes (#5049) Fixes #4973. --- src/parser/smt2/Smt2.g | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index 4bb253603..ea0c3b714 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -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( -- 2.30.2