From ba35dca4fb15108db8e4beefb9a9b49be5f094e9 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 7 Aug 2019 15:19:02 -0700 Subject: [PATCH] Initialize local variables for opcode to fix MSAN failures PiperOrigin-RevId: 262225919 --- mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp b/mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp index 2aa3d5eb515b..1fd9758bde33 100644 --- a/mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp +++ b/mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp @@ -228,7 +228,7 @@ LogicalResult Deserializer::deserialize() { if (failed(processHeader())) return failure(); - spirv::Opcode opcode; + spirv::Opcode opcode = spirv::Opcode::OpNop; ArrayRef operands; auto binarySize = binary.size(); while (curOffset < binarySize) { @@ -376,7 +376,7 @@ LogicalResult Deserializer::processFunction(ArrayRef 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 operands; if (failed(sliceInstruction(opcode, operands, spirv::Opcode::OpFunctionParameter))) { @@ -414,7 +414,7 @@ LogicalResult Deserializer::processFunction(ArrayRef operands) { OpBuilder funcBody(funcOp.getBody()); std::swap(funcBody, opBuilder); - spirv::Opcode opcode; + spirv::Opcode opcode = spirv::Opcode::OpNop; ArrayRef instOperands; while (succeeded(sliceInstruction(opcode, instOperands, spirv::Opcode::OpFunctionEnd)) &&