[llvm] r199811 - [x86] Fix uninitialized variable warning in translate{Src, Dst}Index
David Woodhouse
dwmw2 at infradead.org
Wed Jan 22 07:31:29 PST 2014
Author: dwmw2
Date: Wed Jan 22 09:31:29 2014
New Revision: 199811
URL: http://llvm.org/viewvc/llvm-project?rev=199811&view=rev
Log:
[x86] Fix uninitialized variable warning in translate{Src,Dst}Index
Modified:
llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp
Modified: llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp?rev=199811&r1=199810&r2=199811&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp (original)
+++ llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp Wed Jan 22 09:31:29 2014
@@ -245,8 +245,10 @@ static bool translateSrcIndex(MCInst &mc
baseRegNo = insn.prefixPresent[0x67] ? X86::ESI : X86::RSI;
else if (insn.mode == MODE_32BIT)
baseRegNo = insn.prefixPresent[0x67] ? X86::SI : X86::ESI;
- else if (insn.mode == MODE_16BIT)
+ else {
+ assert(insn.mode == MODE_16BIT);
baseRegNo = insn.prefixPresent[0x67] ? X86::ESI : X86::SI;
+ }
MCOperand baseReg = MCOperand::CreateReg(baseRegNo);
mcInst.addOperand(baseReg);
@@ -269,8 +271,10 @@ static bool translateDstIndex(MCInst &mc
baseRegNo = insn.prefixPresent[0x67] ? X86::EDI : X86::RDI;
else if (insn.mode == MODE_32BIT)
baseRegNo = insn.prefixPresent[0x67] ? X86::DI : X86::EDI;
- else if (insn.mode == MODE_16BIT)
+ else {
+ assert(insn.mode == MODE_16BIT);
baseRegNo = insn.prefixPresent[0x67] ? X86::EDI : X86::DI;
+ }
MCOperand baseReg = MCOperand::CreateReg(baseRegNo);
mcInst.addOperand(baseReg);
return false;
More information about the llvm-commits
mailing list