summaryrefslogtreecommitdiffstats
path: root/src/qdoc/qmlcodemarker.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-03-18 10:31:10 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-03-18 09:56:45 +0000
commit11d01e3b74c84e465246a8f164b3f3b8ff92d8a4 (patch)
tree4be7398ef6a2c2d716f3f5de100144e30181d7ab /src/qdoc/qmlcodemarker.cpp
parentf1391564f6119973f46f0792b77fa65210ef00ae (diff)
Handle recursion depth errors when parsing JavaScript
Implementations of QQmlJS::AST::Visitor are required to do so. Fixes: QTBUG-74510 Change-Id: I061240f15ce082a05dd7829d225a5bfc3edd896a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qdoc/qmlcodemarker.cpp')
-rw-r--r--src/qdoc/qmlcodemarker.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qdoc/qmlcodemarker.cpp b/src/qdoc/qmlcodemarker.cpp
index 1ceba8016..a6f97f031 100644
--- a/src/qdoc/qmlcodemarker.cpp
+++ b/src/qdoc/qmlcodemarker.cpp
@@ -181,6 +181,10 @@ QString QmlCodeMarker::addMarkUp(const QString &code,
// unhandled source text can be output.
QmlMarkupVisitor visitor(code, pragmas, &engine);
QQmlJS::AST::Node::accept(ast, &visitor);
+ if (visitor.hasError()) {
+ location.warning(location.fileName() +
+ tr("Unable to analyze QML snippet. The output is incomplete."));
+ }
output = visitor.markedUpCode();
} else {
location.warning(tr("Unable to parse QML snippet: \"%1\" at line %2, column %3").arg(