[PATCH] D50940: [sanitizer] Change Mmap*NoAccess to return nullptr on error

Kristina Brooks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 20 12:06:05 PDT 2018


kristina added a comment.

In https://reviews.llvm.org/D50940#1206182, @alekseyshl wrote:

> I do support the unification of the return value, and if no call site is currently care for the actual syscall return value, I'd say, let's make all of them return pointer, nullptr or die. MMAP_FAILED might be a reasonable common ground too, but seems like nullptr is used in many places already and Windows returns NULL on failure, so a bit more unification across platforms here.


I think that's a reasonable common ground, seems much better than sanitizers being plagued with the TLV `errno` idiom, so something like a `CHECK` on a failed mmap call or just returning `NULL` (I think latter is better since this concerns the common code used by all sanitizes and some may want to recover).


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D50940





More information about the llvm-commits mailing list