diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-06-03 10:59:53 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-06-03 10:59:53 +0200 |
commit | 9497d364d7dd57a337936c8f627c0564599efb64 (patch) | |
tree | eb91f57b59e4c392c738ffb0f301c27b03c36121 /src/xmlpatterns | |
parent | c04b8c62759aa916551398a5a25b7db14d5519a1 (diff) | |
parent | 8d5f3bd730486b3fd3d5b1782fa70b80108c0ba4 (diff) | |
download | qtxmlpatterns-9497d364d7dd57a337936c8f627c0564599efb64.tar.gz |
Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I40f55a4eabaf2d0d6bcda0a4b6111b27130f24f3
Diffstat (limited to 'src/xmlpatterns')
-rw-r--r-- | src/xmlpatterns/expr/qunaryexpression.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xmlpatterns/expr/qunaryexpression.cpp b/src/xmlpatterns/expr/qunaryexpression.cpp index 1c4524e..f99096b 100644 --- a/src/xmlpatterns/expr/qunaryexpression.cpp +++ b/src/xmlpatterns/expr/qunaryexpression.cpp @@ -59,7 +59,10 @@ Item UnaryExpression::evaluateSingleton(const DynamicContext::Ptr &context) cons { const Item item(m_operand2->evaluateSingleton(context)); - if(item) + if (item) + // If the item is an untypedAtomic (or atomicString), the cast to Numeric will + // return a garbage object and will most likely cause a crash. + // There is simply no way to static cast from an instance of AtomicString to a Number. return item.as<Numeric>()->toNegated(); else return Item(); |