Skip to content

Commit e133bee

Browse files
committed
changes from feedback
1 parent 1fd415f commit e133bee

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -852,25 +852,25 @@ INTERCEPTOR(void *, mmap64, void *addr, size_t length, int prot, int flags,
852852
#endif // SANITIZER_INTERCEPT_MMAP64
853853

854854
#if SANITIZER_LINUX
855-
// Note that even if rtsan is ported to netbsd, it has a different signature
856-
// still
855+
// Note that even if rtsan is ported to netbsd, it has a slighty different
856+
// and non-variadic signature
857857
INTERCEPTOR(void *, mremap, void *oaddr, size_t olength, size_t nlength,
858858
int flags, ...) {
859859
__rtsan_notify_intercepted_call("mremap");
860860

861-
void *naddr = nullptr;
862-
863861
// the last optional argument is only used in this case
864862
// as the new page region will be assigned to. Is ignored otherwise.
865863
if (flags & MREMAP_FIXED) {
866864
va_list args;
867865

868866
va_start(args, flags);
869-
naddr = va_arg(args, void *);
867+
void *naddr = va_arg(args, void *);
870868
va_end(args);
869+
870+
return REAL(mremap)(oaddr, olength, nlength, flags, naddr);
871871
}
872872

873-
return REAL(mremap)(oaddr, olength, nlength, flags, naddr);
873+
return REAL(mremap)(oaddr, olength, nlength, flags);
874874
}
875875
#define RTSAN_MAYBE_INTERCEPT_MREMAP INTERCEPT_FUNCTION(mremap)
876876
#else

0 commit comments

Comments
 (0)