forked from OSchip/llvm-project
Initialize output parameter
Or code like this have UB passing uninitialized CmpValue: ``` int64_t CmpMask, CmpValue; if (!TII->analyzeCompare(MI, SrcReg, SrcReg2, CmpMask, CmpValue)) return false; if (TII->optimizeCompareInstr(MI, SrcReg, SrcReg2, CmpMask, CmpValue, MRI)) { ``` Detected by msan with: -Xclang -enable-noundef-analysis -mllvm -msan-eager-checks=1 Differential Revision: https://reviews.llvm.org/D116831
This commit is contained in:
parent
bd9ae596d8
commit
5c46c1c23a
|
@ -1893,6 +1893,7 @@ bool HexagonInstrInfo::analyzeCompare(const MachineInstr &MI, Register &SrcReg,
|
|||
case Hexagon::C4_cmplte:
|
||||
case Hexagon::C4_cmplteu:
|
||||
SrcReg2 = MI.getOperand(2).getReg();
|
||||
Value = 0;
|
||||
return true;
|
||||
|
||||
case Hexagon::C2_cmpeqi:
|
||||
|
|
Loading…
Reference in New Issue