From 01cdc1798977ba6e53c2439fa45c14889685290a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 16 Feb 2018 19:26:01 -0800 Subject: Fix build with GCC 7: possibly uninitialized array warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qv4bytecodegenerator.cpp:99:19: error: ‘instructionsAsInts[3]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] Change-Id: I940917d6763842499b18fffd1513ff143fc502bb Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4bytecodegenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/compiler') 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(i.type)]; for (int j = 0; j < nMembers; ++j) { instructionsAsInts[j] = qFromLittleEndian(i.packed + 1 + j * sizeof(int)); -- cgit v1.2.3