Skip to content

Commit

Permalink
Cast the fifth arg to mremap to void *
Browse files Browse the repository at this point in the history
Summary:
Since the prototype of mremap is

```
void *mremap(void *old_address, size_t old_size, size_t new_size,
             int flags, ... /* void *new_address*/);
```
we need to cast new_address to void * when calling mremap.  Otherwise,
the wrong value will be passed to mremap on x32.

Patch by H.J Lu!

Reviewers: kcc, eugenis, samsonov

Subscribers: samsonov, llvm-commits

Differential Revision: http://reviews.llvm.org/D16805

llvm-svn: 259540
  • Loading branch information
vonosmas committed Feb 2, 2016
1 parent ecefe5a commit f54e67d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler-rt/lib/cfi/cfi.cc
Expand Up @@ -155,7 +155,7 @@ void ShadowBuilder::Install() {
if (main_shadow) {
// Update.
void *res = mremap((void *)shadow_, GetShadowSize(), GetShadowSize(),
MREMAP_MAYMOVE | MREMAP_FIXED, main_shadow);
MREMAP_MAYMOVE | MREMAP_FIXED, (void *)main_shadow);
CHECK(res != MAP_FAILED);
} else {
// Initial setup.
Expand Down

0 comments on commit f54e67d

Please sign in to comment.