This is an archive of the discontinued LLVM Phabricator instance.

Initialize output parameter
ClosedPublic

Authored by vitalybuka on Jan 7 2022, 11:02 AM.

Details

Summary

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

Diff Detail

Event Timeline

vitalybuka created this revision.Jan 7 2022, 11:02 AM
vitalybuka requested review of this revision.Jan 7 2022, 11:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 7 2022, 11:02 AM
kda accepted this revision.Jan 7 2022, 2:14 PM
This revision is now accepted and ready to land.Jan 7 2022, 2:14 PM
This revision was automatically updated to reflect the committed changes.