[PATCH] D54080: [unittest] Skip W+X MappedMemoryTests when MPROTECT is enabled
Kamil Rytarowski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 3 14:51:41 PDT 2018
krytarowski added inline comments.
================
Comment at: unittests/Support/MemoryTest.cpp:90
+// MPROTECT prevents W+X mmaps
+#define CHECK_UNSUPPORTED() \
+ do { \
----------------
I would further refactor this into:
```
// MPROTECT prevents W+X mmaps
#define CHECK_UNSUPPORTED(f) \
do { \
if ((f & (Memory::MF_WRITE | Memory::MF_EXEC)) && \
IsMPROTECT()) \
return; \
} while (0)
```
And use `CHECK_UNSUPPORTED(Flags)` or `CHECK_UNSUPPORTED(Flags | Memory::MF_WRITE)` for `EnabledWrite`.
https://reviews.llvm.org/D54080
More information about the llvm-commits
mailing list