[PATCH] D17262: [Compiler-rt][MSan]Fix shmat testcase: Pass SHMLBA-alligned address to shmat

Mohit Bhakkad via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 22:13:04 PST 2016


mohit.bhakkad added inline comments.

================
Comment at: lib/msan/tests/msan_test.cc:1222
@@ +1221,3 @@
+  
+  void *p;
+  if ((unsigned long)mapping_start % SHMLBA != 0) {
----------------
samsonov wrote:
> Shouldn't this be
>   void *p = mapping_start;
> ?
> 
> Also, you can just unconditionally round up:
>   void *p = (void*)(((unsigned long)mapping_start + SHMLBA - 1) / SHMLBA * SHMLBA);
Thanks for pointing this out, I will just keep this assignment unconditional.


Repository:
  rL LLVM

http://reviews.llvm.org/D17262





More information about the llvm-commits mailing list