From e9f726d2f8108104d86e967dd27bba1fbe493b19 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Tue, 3 Mar 2015 20:38:32 +0100 Subject: added more complex tests and prevented endless loops in DocumentChildHandler::startAnnotation --- src/core/parser/stack/DocumentHandler.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/parser/stack') diff --git a/src/core/parser/stack/DocumentHandler.cpp b/src/core/parser/stack/DocumentHandler.cpp index 486ce81..c239583 100644 --- a/src/core/parser/stack/DocumentHandler.cpp +++ b/src/core/parser/stack/DocumentHandler.cpp @@ -302,6 +302,16 @@ bool DocumentChildHandler::startAnnotation(Variant::mapType &args) // pop the implicit element. scope().pop(logger()); continue; + } else { + logger().error( + "Cannot start or end annotation within the primitive field \"" + + parent->getDescriptor() + ->getFieldDescriptors()[fieldIdx] + ->getNameOrDefaultName() + + "\" of descriptor \"" + parent->getDescriptor()->getName() + + "\".", + location()); + return false; } } -- cgit v1.2.3