aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2018-02-16 19:26:01 -0800
committerThiago Macieira <thiago.macieira@intel.com>2018-02-21 20:01:25 +0000
commit01cdc1798977ba6e53c2439fa45c14889685290a (patch)
tree6c3b843a7e7770be6078f41ca3e6ebb199be8bee /src/qml/compiler
parentfa2280aecdb9df26ed84942999e68bf14c349e87 (diff)
Fix build with GCC 7: possibly uninitialized array warning
qv4bytecodegenerator.cpp:99:19: error: ‘instructionsAsInts[3]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] Change-Id: I940917d6763842499b18fffd1513ff143fc502bb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r--src/qml/compiler/qv4bytecodegenerator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4bytecodegenerator.cpp b/src/qml/compiler/qv4bytecodegenerator.cpp
index 0978e23b17..4d50654d27 100644
--- a/src/qml/compiler/qv4bytecodegenerator.cpp
+++ b/src/qml/compiler/qv4bytecodegenerator.cpp
@@ -74,7 +74,7 @@ void BytecodeGenerator::packInstruction(I &i)
Q_ASSERT(type >= MOTH_NUM_INSTRUCTIONS());
if (type >= MOTH_NUM_INSTRUCTIONS())
type -= MOTH_NUM_INSTRUCTIONS();
- int instructionsAsInts[sizeof(Instr)/sizeof(int)];
+ int instructionsAsInts[sizeof(Instr)/sizeof(int)] = {};
int nMembers = Moth::InstrInfo::argumentCount[static_cast<int>(i.type)];
for (int j = 0; j < nMembers; ++j) {
instructionsAsInts[j] = qFromLittleEndian<qint32>(i.packed + 1 + j * sizeof(int));