[PATCH] D42645: New simple Checker for mmap calls

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 02:27:47 PST 2018


a.sidorin added a comment.

Hello David,

I have looked into mmap constant definitions in different implementations and found them pretty inconsistent. For example, MMAP_EXEC can be 0x01, 0x04 and I even found 0x00 in some file (https://www.cs.cmu.edu/~dga/crypto/priveth/libethash/mmap.h). Therefore, we should clearly state how do we predict these values. Are you sure that checking `isOSGlibc()` is enough?

Also, could you please explain me how the test works? If I understand correctly, for all platforms we manually define the constants in the test. Then, we check if   `PROT_WRITE | PROT_EXEC` is set. For OSGlibc, PROT_EXEC is defined as 0x01 in the checker. This means that if isOSGlibc branch is covered, we should not get any warnings for one of test launches because `PROT_WRITE | PROT_EXEC` is 0x03 in the checker and is 0x06 in the test file.


Repository:
  rC Clang

https://reviews.llvm.org/D42645





More information about the cfe-commits mailing list