Avoid uninitialized bytes in QV4::CompiledData
authorSimon Hausmann <simon.hausmann@theqtcompany.com>
Tue, 5 May 2015 11:14:36 +0000 (13:14 +0200)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Fri, 8 May 2015 04:08:24 +0000 (04:08 +0000)
commitc31d6e946d700bb404fdcadaba11ac45c714d60d
treec007113110b3dce8ea5dffe84ab8f1907c6388ee
parentc415e6972b371acc288cd835f5635936215c615f
Avoid uninitialized bytes in QV4::CompiledData

When populating the QV4::CompiledData for a JS unit, we memset the malloc'ed
data to zero. We should do the same when creating a unit for QML files. We do
write all the fields that we use, but due to padding we may end up with bytes
that are neither used nor written but still uninitialized. Consequently they
should be zero'ed, otherwise serialization will write garbage.

Change-Id: I0b093e4dde6789d7236247507221f4f3476ba89d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/compiler/qqmlirbuilder.cpp