This is an archive of the discontinued LLVM Phabricator instance.

Fix UB in benchmakrs
ClosedPublic

Authored by vitalybuka on Aug 7 2023, 4:26 PM.

Details

Summary

This is not ideal fixes, but it does not change the
point of the benchmark, so should be good enough here.

  • ix[k] can be 0 causing negative index on array access.
  • p[ip][0] can be outside of Index_type.

Diff Detail

Repository
rT test-suite

Event Timeline

vitalybuka created this revision.Aug 7 2023, 4:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 4:26 PM
vitalybuka requested review of this revision.Aug 7 2023, 4:26 PM
vitalybuka edited the summary of this revision. (Show Details)Aug 7 2023, 4:28 PM
vitalybuka added reviewers: homerdin, rengolin, MaskRay.
MaskRay accepted this revision.Aug 7 2023, 6:05 PM
MaskRay added inline comments.
MicroBenchmarks/LCALS/SubsetCRawLoops/RawSubsetCbenchmarks.cxx
552–553

this may express the intention better

This revision is now accepted and ready to land.Aug 7 2023, 6:05 PM
vitalybuka updated this revision to Diff 548019.Aug 7 2023, 6:37 PM

(Index_type)

vitalybuka marked an inline comment as done.Aug 7 2023, 6:37 PM
MaskRay accepted this revision.Aug 7 2023, 6:42 PM
This revision was automatically updated to reflect the committed changes.