diff options
author | Richard Weickelt <richard@weickelt.de> | 2020-03-29 16:48:34 +0200 |
---|---|---|
committer | Richard Weickelt <richard@weickelt.de> | 2020-04-06 11:41:45 +0000 |
commit | 6f904ec4e8fd8596840038341f408569c7813f0d (patch) | |
tree | 9b1032aa052ce77704d2815d5d6c5a7861105ac4 | |
parent | 3e607549f61e9bc97da1d91edcd7d1a284224766 (diff) |
Exclude VariantValues when checking for conflicts
Qbs prints a warning when different modules contain conflicting assignments to
scalar properties. This check assumed that the source values were always of type
JSSourceValue and thus performed a invalid static cast which caused sporadic
crashes on macOS in TestLanguage::moduleMergingVariantValues. No crashes were
obtained on other platforms, but that was only a coincidence.
This patch amends 8ff1dd00.
Change-Id: Id4809496a5fbc4985d040118a4684f3ac040cdc0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | src/lib/corelib/language/modulemerger.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/corelib/language/modulemerger.cpp b/src/lib/corelib/language/modulemerger.cpp index 5a5bd3ac0..c5deaae04 100644 --- a/src/lib/corelib/language/modulemerger.cpp +++ b/src/lib/corelib/language/modulemerger.cpp @@ -173,7 +173,9 @@ void ModuleMerger::mergeModule(Item::PropertyMap *dstProps, const Item::Module & if (dstVal) { if (srcDecl.isScalar()) { // Scalar properties get replaced. - if (dstVal->type() == Value::JSSourceValueType) { + if ((dstVal->type() == Value::JSSourceValueType) + && (srcVal->type() == Value::JSSourceValueType)) { + // Warn only about conflicting source code values const JSSourceValuePtr dstJsVal = std::static_pointer_cast<JSSourceValue>(dstVal); const JSSourceValuePtr srcJsVal = |