diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2021-10-28 16:33:30 +0200 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2021-10-29 17:49:13 +0200 |
commit | 363c23357501bdbacf9407ef46e7808261486aa8 (patch) | |
tree | 741aeccdb949db21ccfebf86204663922b5fb03f /tools/qmllint | |
parent | d5276d1945393291e76f6d644907d5fd036122f7 (diff) |
qmllint: Fix crash when builtins are not found
Previously builtins not being found would lead to an endless loop that
crashes qmllint. Now missing builtins are handled gracefully,
aborting linting without crashing as this an unrecoverable error.
Change-Id: Ia585b1e0e5c972dad0eeabf8df06edf71eaea0c7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmllint')
-rw-r--r-- | tools/qmllint/main.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/qmllint/main.cpp b/tools/qmllint/main.cpp index 76faa1f601..7dded2a7f9 100644 --- a/tools/qmllint/main.cpp +++ b/tools/qmllint/main.cpp @@ -185,6 +185,9 @@ static bool lint_file(const QString &filename, const bool silent, QJsonArray *js parser.rootNode()->accept(&v); success = v.check(); + if (logger.hasErrors()) + return; + QQmlJSTypeInfo typeInfo; Codegen codegen { &importer, filename, qmltypesFiles, &logger, &typeInfo, code }; QQmlJSSaveFunction saveFunction = [](const QV4::CompiledData::SaveableUnitPointer &, |