summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Analysis/MemorySSA.cpp
diff options
context:
space:
mode:
authorKostya Kortchinsky <kostyak@google.com>2018-08-23 21:13:39 +0000
committerKostya Kortchinsky <kostyak@google.com>2018-08-23 21:13:39 +0000
commit14b838a1ca404bef35edb8458ae4fc12d33fc09a (patch)
treedb099721cd62846513be390c844f16ebab81d365 /llvm/unittests/Analysis/MemorySSA.cpp
parent68c7fcdaf1e694f4d1c6f6e9246d53cc12813fb6 (diff)
downloadbcm5719-llvm-14b838a1ca404bef35edb8458ae4fc12d33fc09a.tar.gz
bcm5719-llvm-14b838a1ca404bef35edb8458ae4fc12d33fc09a.zip
[sanitizer] Change Mmap*NoAccess to return nullptr on error
Summary: `MmapNoAccess` & `MmapFixedNoAccess` return directly the result of `internal_mmap`, as opposed to other Mmap functions that return nullptr. This inconsistency leads to some confusion for the callers, as some check for `~(uptr)0` (`MAP_FAILED`) for failure (while it can fail with `-ENOMEM` for example). Two potential solutions: change the callers, or make the functions return `nullptr` on failure to follow the precedent set by the other functions. The second option looked more appropriate to me. Correct the callers that were wrongly checking for `~(uptr)0` or `MAP_FAILED`. TODO for follow up CLs: - There are a couple of `internal_mmap` calls in XRay that check for MMAP_FAILED as a result as well (cc: @dberris); they should use `internal_iserror`; Reviewers: eugenis, alekseyshl, dberris, kubamracek Reviewed By: alekseyshl Subscribers: kristina, kubamracek, delcypher, #sanitizers, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D50940 llvm-svn: 340576
Diffstat (limited to 'llvm/unittests/Analysis/MemorySSA.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud