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>
This commit is contained in:
Thiago Macieira 2018-02-16 19:26:01 -08:00
parent fa2280aecd
commit 01cdc17989
1 changed files with 1 additions and 1 deletions

View File

@ -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));