This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] Avoid use of std::abs to fix ubsan failure.
AbandonedPublic

Authored by craig.topper on Aug 18 2023, 1:17 PM.

Details

Summary

The input here can be INT64_MIN. We already know the number is
negative on the path that used std::abs. Cast to uint64_t and
negate that.

Diff Detail

Unit TestsFailed

Event Timeline

craig.topper created this revision.Aug 18 2023, 1:17 PM
Herald added a project: Restricted Project. · View Herald Transcript
craig.topper requested review of this revision.Aug 18 2023, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2023, 1:17 PM
craig.topper abandoned this revision.Aug 18 2023, 1:30 PM