mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 16:56:35 +00:00
[NFC][tsan] Fix reallocarray
, calloc
parameters order
Implementation is commutative, so it should make no difference. It's done just for consistency with documentation.
This commit is contained in:
parent
2531b46264
commit
bafe3a4b0c
@ -678,12 +678,12 @@ TSAN_INTERCEPTOR(void*, __libc_memalign, uptr align, uptr sz) {
|
||||
return user_memalign(thr, pc, align, sz);
|
||||
}
|
||||
|
||||
TSAN_INTERCEPTOR(void*, calloc, uptr size, uptr n) {
|
||||
TSAN_INTERCEPTOR(void *, calloc, uptr n, uptr size) {
|
||||
if (in_symbolizer())
|
||||
return InternalCalloc(size, n);
|
||||
return InternalCalloc(n, size);
|
||||
void *p = 0;
|
||||
{
|
||||
SCOPED_INTERCEPTOR_RAW(calloc, size, n);
|
||||
SCOPED_INTERCEPTOR_RAW(calloc, n, size);
|
||||
p = user_calloc(thr, pc, size, n);
|
||||
}
|
||||
invoke_malloc_hook(p, n * size);
|
||||
@ -703,13 +703,13 @@ TSAN_INTERCEPTOR(void*, realloc, void *p, uptr size) {
|
||||
return p;
|
||||
}
|
||||
|
||||
TSAN_INTERCEPTOR(void*, reallocarray, void *p, uptr size, uptr n) {
|
||||
TSAN_INTERCEPTOR(void *, reallocarray, void *p, uptr n, uptr size) {
|
||||
if (in_symbolizer())
|
||||
return InternalReallocArray(p, size, n);
|
||||
return InternalReallocArray(p, n, size);
|
||||
if (p)
|
||||
invoke_free_hook(p);
|
||||
{
|
||||
SCOPED_INTERCEPTOR_RAW(reallocarray, p, size, n);
|
||||
SCOPED_INTERCEPTOR_RAW(reallocarray, p, n, size);
|
||||
p = user_reallocarray(thr, pc, p, size, n);
|
||||
}
|
||||
invoke_malloc_hook(p, size);
|
||||
|
@ -252,7 +252,7 @@ void *user_reallocarray(ThreadState *thr, uptr pc, void *p, uptr size, uptr n) {
|
||||
if (AllocatorMayReturnNull())
|
||||
return SetErrnoOnNull(nullptr);
|
||||
GET_STACK_TRACE_FATAL(thr, pc);
|
||||
ReportReallocArrayOverflow(size, n, &stack);
|
||||
ReportReallocArrayOverflow(n, size, &stack);
|
||||
}
|
||||
return user_realloc(thr, pc, p, size * n);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user