[PATCH] Split Mprotect into MmapNoAccess and MprotectNoAccess to be more portable

Timur Iskhodzhanov timurrrr at google.com
Fri Apr 10 08:37:04 PDT 2015


================
Comment at: lib/asan/asan_rtl.cc:300
@@ -299,2 +299,3 @@
 
 static void ProtectGap(uptr a, uptr size) {
+  void *res = MmapNoAccess(a, size);
----------------
glider wrote:
> The argument name "a" is meaningless, can you please fix?
> (I know it was meaningless before)
Good point, done [r234604]

================
Comment at: lib/sanitizer_common/sanitizer_posix.cc:202
@@ -201,3 +201,3 @@
 
-void *Mprotect(uptr fixed_addr, uptr size) {
+void *MmapNoAccess(uptr fixed_addr, uptr size) {
   return (void *)internal_mmap((void*)fixed_addr, size,
----------------
glider wrote:
> Why not return an uptr here?
> IIRC the result of internal_mmap() is an uptr, which is cast to void* here, returned and then cast to an uptr by the callers of MmapNoAccess().
We've discussed this offline and decided not to do that for consistency with other `Mmap`s.
If anything, we should change the types of the parameters...

http://reviews.llvm.org/D8970

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list