This is an archive of the discontinued LLVM Phabricator instance.

hwasan: Ignore loads and stores of size 0.
ClosedPublic

Authored by pcc on Jan 8 2019, 4:39 PM.

Details

Summary

Now that memory intrinsics are instrumented, it's more likely that
CheckAddressSized will be called with size 0. (It was possible before
with IR like:

%val = load [0 x i8], [0 x i8]* %ptr

but I don't think clang will generate IR like that and the optimizer
would normally remove it by the time it got anyhere near our pass
anyway). The right thing to do in both cases is to disable the
addressing checks (since the underlying memory intrinsic is a no-op),
so that's what we do.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc created this revision.Jan 8 2019, 4:39 PM
eugenis accepted this revision.Jan 8 2019, 4:42 PM

LGTM

This revision is now accepted and ready to land.Jan 8 2019, 4:42 PM
This revision was automatically updated to reflect the committed changes.