[PATCH] D116831: Initialize output parameter
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 7 11:02:43 PST 2022
vitalybuka created this revision.
vitalybuka added reviewers: kda, eugenis.
Herald added a subscriber: hiraditya.
vitalybuka requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
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
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D116831
Files:
llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
Index: llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
===================================================================
--- llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
+++ llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
@@ -1893,6 +1893,7 @@
case Hexagon::C4_cmplte:
case Hexagon::C4_cmplteu:
SrcReg2 = MI.getOperand(2).getReg();
+ Value = 0;
return true;
case Hexagon::C2_cmpeqi:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116831.398202.patch
Type: text/x-patch
Size: 415 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220107/76d45193/attachment.bin>
More information about the llvm-commits
mailing list