diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-12-01 15:34:52 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-12-03 08:20:52 +0100 |
commit | 7d911956b9074184898c26c12f1280a98eadfc04 (patch) | |
tree | 8f14c2b96d34fc27d823aa416d071992340f76d3 /src/qmlcompiler/qqmljscodegenerator.cpp | |
parent | 34efbd202287b0fd0611b48938a1678edb2b2e45 (diff) |
QmlCompiler: Disallow access to IDs in other components
There is no guarantee that this works.
Fixes: QTBUG-98830
Pick-to: 6.2
Change-Id: Id205170a41caa4bed264864a1ff35a57303641e9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljscodegenerator.cpp')
-rw-r--r-- | src/qmlcompiler/qqmljscodegenerator.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/qmlcompiler/qqmljscodegenerator.cpp b/src/qmlcompiler/qqmljscodegenerator.cpp index 785f959a31..a3cd7cdd91 100644 --- a/src/qmlcompiler/qqmljscodegenerator.cpp +++ b/src/qmlcompiler/qqmljscodegenerator.cpp @@ -695,7 +695,7 @@ void QQmlJSCodeGenerator::generate_LoadQmlContextPropertyLookup(int index) } const QString indexString = QString::number(index); - const QQmlJSScope::ConstPtr scopeForId = m_typeResolver->scopeForId(name); + const QQmlJSScope::ConstPtr scopeForId = m_typeResolver->scopeForId(name, m_function->qmlScope); if (!scopeForId.isNull()) { const QString lookup = u"aotContext->loadContextIdLookup("_qs + indexString + u", &"_qs + m_state.accumulatorVariableOut + u')'; @@ -706,8 +706,6 @@ void QQmlJSCodeGenerator::generate_LoadQmlContextPropertyLookup(int index) } const bool isProperty = m_state.accumulatorOut.isProperty(); - QQmlJSScope::ConstPtr qmlScope = QQmlJSScope::findCurrentQMLScope(m_function->qmlScope); - const QQmlJSScope::ConstPtr scope = m_state.accumulatorOut.scopeType(); const QQmlJSScope::ConstPtr stored = m_state.accumulatorOut.storedType(); if (isProperty) { |