Initialize local variables for opcode to fix MSAN failures

PiperOrigin-RevId: 262225919
This commit is contained in:
Lei Zhang 2019-08-07 15:19:02 -07:00 committed by A. Unique TensorFlower
parent 8089f93746
commit ba35dca4fb
1 changed files with 3 additions and 3 deletions

View File

@ -228,7 +228,7 @@ LogicalResult Deserializer::deserialize() {
if (failed(processHeader()))
return failure();
spirv::Opcode opcode;
spirv::Opcode opcode = spirv::Opcode::OpNop;
ArrayRef<uint32_t> operands;
auto binarySize = binary.size();
while (curOffset < binarySize) {
@ -376,7 +376,7 @@ LogicalResult Deserializer::processFunction(ArrayRef<uint32_t> operands) {
if (functionType.getNumInputs()) {
for (size_t i = 0, e = functionType.getNumInputs(); i != e; ++i) {
auto argType = functionType.getInput(i);
spirv::Opcode opcode;
spirv::Opcode opcode = spirv::Opcode::OpNop;
ArrayRef<uint32_t> operands;
if (failed(sliceInstruction(opcode, operands,
spirv::Opcode::OpFunctionParameter))) {
@ -414,7 +414,7 @@ LogicalResult Deserializer::processFunction(ArrayRef<uint32_t> operands) {
OpBuilder funcBody(funcOp.getBody());
std::swap(funcBody, opBuilder);
spirv::Opcode opcode;
spirv::Opcode opcode = spirv::Opcode::OpNop;
ArrayRef<uint32_t> instOperands;
while (succeeded(sliceInstruction(opcode, instOperands,
spirv::Opcode::OpFunctionEnd)) &&