diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2018-10-12 10:47:51 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-04-16 06:13:50 +0000 |
commit | 5fcc9906d7b6d19ea3d79ccf0d6446d01b583973 (patch) | |
tree | 6f4c07dca3d70ae2ef5729383df159b4a7d4312b /src/qml/compiler | |
parent | c8d00be64979c7d2b607eb88de9f3d4212f1c50d (diff) |
QML: Check for (valid) compilation units while hashing
When an error occurred while creating a compilation unit, the pointer
might be set to null. Subsequent use in hashing should check for this,
and not use a nullptr.
Change-Id: I62650917a740c9c1be29608285670153bed8703c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r-- | src/qml/compiler/qv4compileddata.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index 8f2f4a11c1..9fb91e9140 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -897,6 +897,8 @@ bool ResolvedTypeReference::addToHash(QCryptographicHash *hash, QQmlEngine *engi hash->addData(createPropertyCache(engine)->checksum(&ok)); return ok; } + if (!compilationUnit) + return false; hash->addData(compilationUnit->unitData()->md5Checksum, sizeof(compilationUnit->unitData()->md5Checksum)); return true; } |