This is an archive of the discontinued LLVM Phabricator instance.

[LSan] Make LSan allocator allocator_may_return_null compliant
ClosedPublic

Authored by alekseyshl on Jun 28 2017, 4:10 PM.

Details

Summary

LSan allocator used to always return nullptr on too big allocation requests
(the definition of "too big" depends on platform and bitness), now it
follows policy configured by allocator_may_return_null flag.

Diff Detail

Repository
rL LLVM

Event Timeline

alekseyshl created this revision.Jun 28 2017, 4:10 PM
eugenis accepted this revision.Jun 28 2017, 5:41 PM
eugenis added inline comments.
lib/lsan/lsan_allocator.cc
137 ↗(On Diff #104538)

Could you rename this to something like CallocShouldFailDueToOverflow or even CallocWouldOverflow ?

This revision is now accepted and ready to land.Jun 28 2017, 5:41 PM
alekseyshl added inline comments.Jun 28 2017, 6:02 PM
lib/lsan/lsan_allocator.cc
137 ↗(On Diff #104538)

Will do as a separate patch.

This revision was automatically updated to reflect the committed changes.