From 2c22421889d0ac4887d6030d64793a228e626e60 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 29 Sep 2024 19:15:18 +0200 Subject: [PATCH] Don't consume token on invalid entity typename #5504 --- src/ifcparse/IfcParse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index c2f2cf5119..544c4b6600 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -715,10 +715,10 @@ void IfcParse::IfcFile::load(unsigned entity_instance_name, const IfcParse::enti if (TokenFunc::isKeyword(next)) { try { + const auto* decl = schema_->declaration_by_name(TokenFunc::asStringRef(next)); parse_context ps; tokens->Next(); load(0, nullptr, ps, -1); - const auto *decl = schema_->declaration_by_name(TokenFunc::asStringRef(next)); auto* simple_type_instance = schema_->instantiate(decl, ps.construct(-1, references_to_resolve, decl, boost::none)); //@todo decide addEntity(((IfcUtil::IfcBaseClass*)*entity)); context.push(simple_type_instance);