This is an archive of the discontinued LLVM Phabricator instance.

ubsan: fix few format string bugs
ClosedPublic

Authored by dvyukov on Aug 12 2021, 11:20 AM.

Details

Summary

This fixes just a few of the warnings.
Ubsan is not completely clean yet,
but these somehow pop up while I was
fixing other sanitizers.

Depends on D107983.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Aug 12 2021, 11:20 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2021, 11:20 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.Aug 12 2021, 12:21 PM
vitalybuka added inline comments.
compiler-rt/lib/ubsan/ubsan_diag.cpp
172

%zx drops leading zeros, %p don't
would it be better to reinterpret_cast<void*> and %p here?

This revision is now accepted and ready to land.Aug 12 2021, 12:21 PM
dvyukov updated this revision to Diff 366191.Aug 12 2021, 10:44 PM
dvyukov marked an inline comment as done.

use %p to print user reports

compiler-rt/lib/ubsan/ubsan_diag.cpp
172

Done.
I tried to use '%p' in files that print user reports, but missed this one.

This revision was automatically updated to reflect the committed changes.