HomePhabricator

Fix a "memset clearing an object of non-trivial type" warning in…

Description

Fix a "memset clearing an object of non-trivial type" warning in EmulateInstruction

This is a new warning which started appearing as of gcc-8. The Opcode
class has a non-trivial constructor, so the idea of the warning is that
code should use that to initialize the object instead of using memset
(which can perturb class invariants set up by the constructor). In this
case, the Opcode default constructor was already clearing the object's
fields so we can just drop the memset call.

While I'm touching the EmulateInstruction constructor, I also move the
initialization of other members into the class declaration.

Details

Committed
labathMar 19 2019, 8:05 AM
Branches
Unknown
Tags
Unknown