Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.7' into 5.8
Browse files Browse the repository at this point in the history
Conflicts:
	mkspecs/common/linux-android.conf
	src/gui/opengl/qopengl.h
	src/network/socket/qnativesocketengine_winrt.cpp
	src/network/socket/qnativesocketengine_winrt_p.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
	src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
	sync.profile

Change-Id: If70aaf2c49df91157b864cf0d7d9513546c9bec4
  • Loading branch information
liangqi committed Nov 16, 2016
2 parents 1a43199 + 9808b53 commit 90c4256
Show file tree
Hide file tree
Showing 98 changed files with 808 additions and 326 deletions.
1 change: 1 addition & 0 deletions config.tests/unix/opengldesktop/opengldesktop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#ifdef __APPLE__
#include <OpenGL/gl.h>
#else
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#endif

Expand Down
1 change: 1 addition & 0 deletions config.tests/unix/opengles2/opengles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#ifdef BUILD_ON_MAC
#include <OpenGLES/ES2/gl.h>
#else
#define GL_GLEXT_PROTOTYPES
#include <GLES2/gl2.h>
#endif

Expand Down
1 change: 1 addition & 0 deletions config.tests/unix/opengles3/opengles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#ifdef BUILD_ON_MAC
#include <OpenGLES/ES3/gl.h>
#else
#define GL_GLEXT_PROTOTYPES
#include <GLES3/gl3.h>
#endif

Expand Down
6 changes: 3 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1104,14 +1104,14 @@ if [ "$Edition" = "OpenSource" ]; then
while true; do
if [ "$CFG_ANDROID_STYLE_ASSETS" = "no" ] || [ "$XPLATFORM_ANDROID" = "no" ]; then
echo "You are licensed to use this software under the terms of"
echo "the GNU Lesser General Public License (LGPL) versions 3."
echo "the GNU Lesser General Public License (LGPL) version 3."
echo "You are also licensed to use this software under the terms of"
echo "the GNU General Public License (GPL) versions 2."
echo "the GNU General Public License (GPL) version 2."
affix="either"
showGPL2="yes"
else
echo "You are licensed to use this software under the terms of"
echo "the GNU Lesser General Public License (LGPL) versions 3."
echo "the GNU Lesser General Public License (LGPL) version 3."
showGPL2="no"
affix="the"
fi
Expand Down
113 changes: 0 additions & 113 deletions mkspecs/common/linux-android.conf

This file was deleted.

2 changes: 1 addition & 1 deletion mkspecs/features/mac/asset_catalogs.prf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
actool_output_files = $$system(\
mkdir -p $$system_quote($$QMAKE_ASSET_CATALOGS_BUILD_PATH) && \
/usr/libexec/PlistBuddy -c \'Print :com.apple.actool.compilation-results:output-files\' \
/dev/stdin <<< $($${asset_catalog_compiler.commands} 2>/dev/null) | grep \'^ .*$\', lines)
/dev/stdin <<< $($${asset_catalog_compiler.commands} 2>/dev/null) | sed -Ene \'s/^ +//p\', lines)

for (output_file, actool_output_files) {
!equals(output_file, $$asset_catalog_compiler.target): \
Expand Down
17 changes: 16 additions & 1 deletion qmake/generators/win32/msbuild_objectmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,21 @@ static inline QString toString(subSystemOption option)
return QString();
}

static inline QString toString(triState genDebugInfo, linkerDebugOption option)
{
switch (genDebugInfo) {
case unset:
break;
case _False:
return "false";
case _True:
if (option == linkerDebugOptionFastLink)
return "DebugFastLink";
return "true";
}
return QString();
}

static inline QString toString(machineTypeOption option)
{
switch (option) {
Expand Down Expand Up @@ -1536,7 +1551,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCLinkerTool &tool)
<< attrTagS(_EntryPointSymbol, tool.EntryPointSymbol)
<< attrTagX(_ForceSymbolReferences, tool.ForceSymbolReferences, ";")
<< attrTagS(_FunctionOrder, tool.FunctionOrder)
<< attrTagT(_GenerateDebugInformation, tool.GenerateDebugInformation)
<< attrTagS(_GenerateDebugInformation, toString(tool.GenerateDebugInformation, tool.DebugInfoOption))
<< attrTagT(_GenerateManifest, tool.GenerateManifest)
<< attrTagT(_GenerateWindowsMetadata, tool.GenerateWindowsMetadata)
<< attrTagS(_WindowsMetadataFile, tool.GenerateWindowsMetadata == _True ? tool.WindowsMetadataFile : QString())
Expand Down
4 changes: 3 additions & 1 deletion qmake/generators/win32/msvc_objectmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1425,8 +1425,10 @@ bool VCLinkerTool::parseOption(const char* option)
}else
EnableUAC = _True;
break;
case 0x3389797: // /DEBUG
case 0x3389797: // /DEBUG[:FASTLINK]
GenerateDebugInformation = _True;
if (config->CompilerVersion >= NET2015 && strcmp(option + 7, "FASTLINK") == 0)
DebugInfoOption = linkerDebugOptionFastLink;
break;
case 0x0033896: // /DEF:filename
ModuleDefinitionFile = option+5;
Expand Down
5 changes: 5 additions & 0 deletions qmake/generators/win32/msvc_objectmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ enum inlineExpansionOption {
expandAnySuitable,
expandDefault // Not useful number, but stops the output
};
enum linkerDebugOption {
linkerDebugOptionNone,
linkerDebugOptionFastLink
};
enum linkIncrementalType {
linkIncrementalDefault,
linkIncrementalNo,
Expand Down Expand Up @@ -590,6 +594,7 @@ class VCLinkerTool : public VCToolBase
QStringList ForceSymbolReferences;
QString FunctionOrder;
triState GenerateDebugInformation;
linkerDebugOption DebugInfoOption;
triState GenerateMapFile;
qlonglong HeapCommitSize;
qlonglong HeapReserveSize;
Expand Down
3 changes: 1 addition & 2 deletions qmake/library/qmakebuiltins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
int end = -1;
if (func_t == E_SECTION) {
if (args.count() != 3 && args.count() != 4) {
evalError(fL1S("%1(var) section(var, sep, begin, end) requires"
" three or four arguments.").arg(func.toQString(m_tmp1)));
evalError(fL1S("section(var, sep, begin, end) requires three or four arguments."));
} else {
var = args[0];
sep = args.at(1).toQString();
Expand Down
53 changes: 28 additions & 25 deletions qmake/property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,41 @@ static const struct {
const char *name;
QLibraryInfo::LibraryLocation loc;
bool raw;
bool singular;
} propList[] = {
{ "QT_SYSROOT", QLibraryInfo::SysrootPath, true },
{ "QT_INSTALL_PREFIX", QLibraryInfo::PrefixPath, false },
{ "QT_INSTALL_ARCHDATA", QLibraryInfo::ArchDataPath, false },
{ "QT_INSTALL_DATA", QLibraryInfo::DataPath, false },
{ "QT_INSTALL_DOCS", QLibraryInfo::DocumentationPath, false },
{ "QT_INSTALL_HEADERS", QLibraryInfo::HeadersPath, false },
{ "QT_INSTALL_LIBS", QLibraryInfo::LibrariesPath, false },
{ "QT_INSTALL_LIBEXECS", QLibraryInfo::LibraryExecutablesPath, false },
{ "QT_INSTALL_BINS", QLibraryInfo::BinariesPath, false },
{ "QT_INSTALL_TESTS", QLibraryInfo::TestsPath, false },
{ "QT_INSTALL_PLUGINS", QLibraryInfo::PluginsPath, false },
{ "QT_INSTALL_IMPORTS", QLibraryInfo::ImportsPath, false },
{ "QT_INSTALL_QML", QLibraryInfo::Qml2ImportsPath, false },
{ "QT_INSTALL_TRANSLATIONS", QLibraryInfo::TranslationsPath, false },
{ "QT_INSTALL_CONFIGURATION", QLibraryInfo::SettingsPath, false },
{ "QT_INSTALL_EXAMPLES", QLibraryInfo::ExamplesPath, false },
{ "QT_INSTALL_DEMOS", QLibraryInfo::ExamplesPath, false }, // Just backwards compat
{ "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true },
{ "QT_HOST_DATA", QLibraryInfo::HostDataPath, true },
{ "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true },
{ "QT_HOST_LIBS", QLibraryInfo::HostLibrariesPath, true },
{ "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true },
{ "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true },
{ "QT_SYSROOT", QLibraryInfo::SysrootPath, true, true },
{ "QT_INSTALL_PREFIX", QLibraryInfo::PrefixPath, false, false },
{ "QT_INSTALL_ARCHDATA", QLibraryInfo::ArchDataPath, false, false },
{ "QT_INSTALL_DATA", QLibraryInfo::DataPath, false, false },
{ "QT_INSTALL_DOCS", QLibraryInfo::DocumentationPath, false, false },
{ "QT_INSTALL_HEADERS", QLibraryInfo::HeadersPath, false, false },
{ "QT_INSTALL_LIBS", QLibraryInfo::LibrariesPath, false, false },
{ "QT_INSTALL_LIBEXECS", QLibraryInfo::LibraryExecutablesPath, false, false },
{ "QT_INSTALL_BINS", QLibraryInfo::BinariesPath, false, false },
{ "QT_INSTALL_TESTS", QLibraryInfo::TestsPath, false, false },
{ "QT_INSTALL_PLUGINS", QLibraryInfo::PluginsPath, false, false },
{ "QT_INSTALL_IMPORTS", QLibraryInfo::ImportsPath, false, false },
{ "QT_INSTALL_QML", QLibraryInfo::Qml2ImportsPath, false, false },
{ "QT_INSTALL_TRANSLATIONS", QLibraryInfo::TranslationsPath, false, false },
{ "QT_INSTALL_CONFIGURATION", QLibraryInfo::SettingsPath, false, false },
{ "QT_INSTALL_EXAMPLES", QLibraryInfo::ExamplesPath, false, false },
{ "QT_INSTALL_DEMOS", QLibraryInfo::ExamplesPath, false, false }, // Just backwards compat
{ "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true, false },
{ "QT_HOST_DATA", QLibraryInfo::HostDataPath, true, false },
{ "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true, false },
{ "QT_HOST_LIBS", QLibraryInfo::HostLibrariesPath, true, false },
{ "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true, true },
{ "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true, true },
};

QMakeProperty::QMakeProperty() : settings(0)
{
for (unsigned i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) {
QString name = QString::fromLatin1(propList[i].name);
m_values[ProKey(name + "/src")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectiveSourcePaths);
m_values[ProKey(name + "/get")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths);
if (!propList[i].singular) {
m_values[ProKey(name + "/src")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectiveSourcePaths);
m_values[ProKey(name + "/get")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths);
}
QString val = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::FinalPaths);
if (!propList[i].raw) {
m_values[ProKey(name + "/dev")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::DevicePaths);
Expand Down
25 changes: 13 additions & 12 deletions src/corelib/json/qjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ bool Data::valid() const
return false;

bool res = false;
if (header->root()->is_object)
res = static_cast<Object *>(header->root())->isValid();
Base *root = header->root();
int maxSize = alloc - sizeof(Header);
if (root->is_object)
res = static_cast<Object *>(root)->isValid(maxSize);
else
res = static_cast<Array *>(header->root())->isValid();
res = static_cast<Array *>(root)->isValid(maxSize);

return res;
}
Expand Down Expand Up @@ -223,9 +225,9 @@ int Object::indexOf(QLatin1String key, bool *exists) const
return min;
}

bool Object::isValid() const
bool Object::isValid(int maxSize) const
{
if (tableOffset + length*sizeof(offset) > size)
if (size > (uint)maxSize || tableOffset + length*sizeof(offset) > size)
return false;

QString lastKey;
Expand All @@ -234,8 +236,7 @@ bool Object::isValid() const
if (entryOffset + sizeof(Entry) >= tableOffset)
return false;
Entry *e = entryAt(i);
int s = e->size();
if (table()[i] + s > tableOffset)
if (!e->isValid(tableOffset - table()[i]))
return false;
QString key = e->key();
if (key < lastKey)
Expand All @@ -249,9 +250,9 @@ bool Object::isValid() const



bool Array::isValid() const
bool Array::isValid(int maxSize) const
{
if (tableOffset + length*sizeof(offset) > size)
if (size > (uint)maxSize || tableOffset + length*sizeof(offset) > size)
return false;

for (uint i = 0; i < length; ++i) {
Expand Down Expand Up @@ -359,12 +360,12 @@ bool Value::isValid(const Base *b) const
int s = usedStorage(b);
if (!s)
return true;
if (s < 0 || offset + s > (int)b->tableOffset)
if (s < 0 || s > (int)b->tableOffset - offset)
return false;
if (type == QJsonValue::Array)
return static_cast<Array *>(base(b))->isValid();
return static_cast<Array *>(base(b))->isValid(s);
if (type == QJsonValue::Object)
return static_cast<Object *>(base(b))->isValid();
return static_cast<Object *>(base(b))->isValid(s);
return true;
}

Expand Down
Loading

0 comments on commit 90c4256

Please sign in to comment.