This is an archive of the discontinued LLVM Phabricator instance.

[memprof] Fix UB.
ClosedPublic

Authored by fmayer on Feb 11 2022, 12:21 PM.

Details

Summary

An infinite loop without any effects is illegal C++ and can be optimized
away by the compiler.

Diff Detail

Event Timeline

fmayer requested review of this revision.Feb 11 2022, 12:21 PM
fmayer created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2022, 12:21 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

This was modeled on AsanDie from compiler-rt/lib/asan/asan_rtl.cpp. Do you want to go ahead and fix them both?

fmayer updated this revision to Diff 407999.Feb 11 2022, 12:46 PM

remove include

This was modeled on AsanDie from compiler-rt/lib/asan/asan_rtl.cpp. Do you want to go ahead and fix them both?

Done and changed memprof code to not use any system includes. We try to avoid those in ASAN RT.

vitalybuka accepted this revision.Feb 11 2022, 12:50 PM
This revision is now accepted and ready to land.Feb 11 2022, 12:50 PM
This revision was landed with ongoing or failed builds.Feb 11 2022, 1:01 PM
Closed by commit rGd49aaaf44f50: [memprof] Fix UB. (authored by fmayer). · Explain Why
This revision was automatically updated to reflect the committed changes.