From 03b19f4fecee22f90fc55cc547e2227e69baea13 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 26 Apr 2019 16:38:38 +0200 Subject: PinchHandler: change qCInfo to qCDebug qCInfo is enabled by default, so this turns into noise for users. Task-number: QTBUG-70083 Change-Id: Ie7f50d393055846bd2f9935c2bbe72830b1b24a3 Reviewed-by: Mitch Curtis --- src/quick/handlers/qquickpinchhandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/handlers/qquickpinchhandler.cpp b/src/quick/handlers/qquickpinchhandler.cpp index 9ae2116d39..dc1a9a92f9 100644 --- a/src/quick/handlers/qquickpinchhandler.cpp +++ b/src/quick/handlers/qquickpinchhandler.cpp @@ -285,9 +285,9 @@ void QQuickPinchHandler::onActiveChanged() m_startScale = m_accumulatedScale; m_startRotation = 0; } - qCInfo(lcPinchHandler) << "activated with starting scale" << m_startScale << "rotation" << m_startRotation; + qCDebug(lcPinchHandler) << "activated with starting scale" << m_startScale << "rotation" << m_startRotation; } else { - qCInfo(lcPinchHandler) << "deactivated with scale" << m_activeScale << "rotation" << m_activeRotation; + qCDebug(lcPinchHandler) << "deactivated with scale" << m_activeScale << "rotation" << m_activeRotation; } } -- cgit v1.2.3 From d4239d2bf94274d849344a95f94dba65c1c22999 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 29 Apr 2019 09:55:54 +0200 Subject: Fix maximum call stack depth for clang ASAN builds For clang we need to use has_feature to detect the presence of an ASAN build. Amends commit eb363c3a0b7f96015d7b8f2551dbeaa86f5acf16 Task-number: QTBUG-75410 Change-Id: I2adb69deb07f8c6b77be8c2f23751fd0a2bbdb95 Reviewed-by: Erik Verbruggen --- src/qml/jsruntime/qv4engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 966ff12506..b6000dbcca 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -169,7 +169,7 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine) bool ok = false; maxCallDepth = qEnvironmentVariableIntValue("QV4_MAX_CALL_DEPTH", &ok); if (!ok || maxCallDepth <= 0) { -#if defined(QT_NO_DEBUG) && !defined(__SANITIZE_ADDRESS__) +#if defined(QT_NO_DEBUG) && !defined(__SANITIZE_ADDRESS__) && !QT_HAS_FEATURE(address_sanitizer) maxCallDepth = 1234; #else // no (tail call) optimization is done, so there'll be a lot mare stack frames active -- cgit v1.2.3 From a452f14fd9b20b429048fc28aeac0c0542484a50 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 29 Apr 2019 11:48:10 +0200 Subject: Fix coverity warning Commit bc00353cffbfe0f74b602a16452f2e7bcd588152 accidentally removed the assert that expressed how objectForId will always succeed with the alias target. That caused coverity to complain that objectAt() may be called with a negative (then array) index. Change-Id: I8651e0826c92e41ab00bf8a44f1abfd1cbfb0e06 Reviewed-by: Ulf Hermann --- src/qml/compiler/qqmlpropertycachecreator_p.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/qml/compiler/qqmlpropertycachecreator_p.h b/src/qml/compiler/qqmlpropertycachecreator_p.h index 074dc98648..901602d17b 100644 --- a/src/qml/compiler/qqmlpropertycachecreator_p.h +++ b/src/qml/compiler/qqmlpropertycachecreator_p.h @@ -703,8 +703,9 @@ inline QQmlCompileError QQmlPropertyCacheAliasCreator::property QVarLengthArray seenAliases({lastAlias}); do { - const CompiledObject *targetObject = objectContainer->objectAt( - objectForId(component, lastAlias->targetObjectId)); + const int targetObjectIndex = objectForId(component, lastAlias->targetObjectId); + Q_ASSERT(targetObjectIndex >= 0); + const CompiledObject *targetObject = objectContainer->objectAt(targetObjectIndex); Q_ASSERT(targetObject); auto nextAlias = targetObject->aliasesBegin(); -- cgit v1.2.3 From 4fea3ec29c9911522a379a01418394b5cad29ecc Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 29 Apr 2019 16:44:48 +0200 Subject: Skip block context within call contexts when searching for parameters Only the call context contains the signal parameters. However, there can be any number of nested block contexts in a function. This manifests itself when the function needs an execution context. The simplest way to trigger this is attaching a debugger. Fixes: QTBUG-75393 Change-Id: Iabdc06a9fe7bf88204525d6940b626575fee1579 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4qmlcontext.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp index 12ada7ee70..0c5226d46c 100644 --- a/src/qml/jsruntime/qv4qmlcontext.cpp +++ b/src/qml/jsruntime/qv4qmlcontext.cpp @@ -458,11 +458,17 @@ ReturnedValue QQmlContextWrapper::resolveQmlContextPropertyLookupGetter(Lookup * // into the handler expression through the locals of the call context. So for onClicked: { ... } // the parameters of the clicked signal are injected and we must allow for them to be found here // before any other property from the QML context. - ExecutionContext &ctx = static_cast(engine->currentStackFrame->jsFrame->context); - if (ctx.d()->type == Heap::ExecutionContext::Type_CallContext) { - uint index = ctx.d()->internalClass->indexOfValueOrGetter(name); - if (index < UINT_MAX) - return static_cast(ctx.d())->locals[index].asReturnedValue(); + for (Heap::ExecutionContext *ctx = engine->currentContext()->d(); ctx; ctx = ctx->outer) { + if (ctx->type == Heap::ExecutionContext::Type_CallContext) { + const uint index = ctx->internalClass->indexOfValueOrGetter(name); + if (index < std::numeric_limits::max()) + return static_cast(ctx)->locals[index].asReturnedValue(); + } + + // Skip only block contexts within the current call context. + // Other contexts need a regular QML property lookup. See below. + if (ctx->type != Heap::ExecutionContext::Type_BlockContext) + break; } bool hasProperty = false; -- cgit v1.2.3 From ac0d313ab15aa78c444d00ed6a1a202a1351dfa1 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 30 Apr 2019 13:29:45 +0200 Subject: Yarr: Reject quantifiers larger than 16M Nobody needs those and we run into integer overflows later on if we accept them. Fixes: QTBUG-74048 Change-Id: Ib8ccd05e4bd6f662c38fbe95bf1350f81982e1b8 Reviewed-by: Simon Hausmann --- src/3rdparty/masm/yarr/YarrParser.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty/masm/yarr/YarrParser.h b/src/3rdparty/masm/yarr/YarrParser.h index 3e5311f1fb..edc6beb1f0 100644 --- a/src/3rdparty/masm/yarr/YarrParser.h +++ b/src/3rdparty/masm/yarr/YarrParser.h @@ -694,7 +694,8 @@ private: ASSERT(!hasError(m_errorCode)); ASSERT(min <= max); - if (min == UINT_MAX) { + const unsigned quantifyLimit = 1 << 24; + if (min > quantifyLimit || (max != quantifyInfinite && max > quantifyLimit)) { m_errorCode = ErrorCode::QuantifierTooLarge; return; } -- cgit v1.2.3 From 6c26a1a137ff328ea144bccc5cb9ad52d71cf67d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 30 Apr 2019 14:50:49 +0200 Subject: Fix -Winit-list-lifetime Enable by -Wextra in gcc 9. Change-Id: I6642240f7ff9fe9f5fc6a456b66d86c9591eaf5f Reviewed-by: Ulf Hermann --- src/qmldebug/qqmlprofilerevent_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/qmldebug/qqmlprofilerevent_p.h b/src/qmldebug/qqmlprofilerevent_p.h index 1e205d8dbb..a7e37d1964 100644 --- a/src/qmldebug/qqmlprofilerevent_p.h +++ b/src/qmldebug/qqmlprofilerevent_p.h @@ -291,7 +291,7 @@ private: squeeze(const Container &numbers) { typedef typename QIntegerForSize::Signed Small; - foreach (Number item, numbers) { + for (Number item : numbers) { if (!squeezable(item)) return false; } -- cgit v1.2.3