diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-01-05 14:16:27 +0000 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-01-05 14:16:27 +0000 |
commit | e49c817d432fcb9a8a7ab985cf052e0dfcdd4c00 (patch) | |
tree | a8f495e481ef74caad535ba5ba0bd12eadeba9a2 /user/valgrind/realloc.patch | |
parent | 4da96e7064d7e4c9781b323a0d2b1a9de06acded (diff) | |
download | packages-e49c817d432fcb9a8a7ab985cf052e0dfcdd4c00.tar.gz packages-e49c817d432fcb9a8a7ab985cf052e0dfcdd4c00.tar.bz2 packages-e49c817d432fcb9a8a7ab985cf052e0dfcdd4c00.tar.xz packages-e49c817d432fcb9a8a7ab985cf052e0dfcdd4c00.zip |
user/valgrind: fix realloc issue
Diffstat (limited to 'user/valgrind/realloc.patch')
-rw-r--r-- | user/valgrind/realloc.patch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/user/valgrind/realloc.patch b/user/valgrind/realloc.patch new file mode 100644 index 000000000..d0eb795b8 --- /dev/null +++ b/user/valgrind/realloc.patch @@ -0,0 +1,24 @@ +--- valgrind-3.13.0/coregrind/m_replacemalloc/vg_replace_malloc.c ++++ valgrind-3.13.0/coregrind/m_replacemalloc/vg_replace_malloc.c +@@ -765,13 +765,15 @@ static void init(void); + DO_INIT; \ + MALLOC_TRACE("realloc(%p,%llu)", ptrV, (ULong)new_size ); \ + \ +- if (ptrV == NULL) \ +- /* We need to call a malloc-like function; so let's use \ +- one which we know exists. */ \ +- return VG_REPLACE_FUNCTION_EZU(10010,VG_Z_LIBC_SONAME,malloc) \ +- (new_size); \ ++ if (ptrV == NULL) { \ ++ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(new_size); \ ++ v = (void*)VALGRIND_NON_SIMD_CALL1( info.tl_malloc, new_size ); \ ++ MALLOC_TRACE(" = %p\n", v ); \ ++ return v; \ ++ } \ + if (new_size <= 0) { \ +- VG_REPLACE_FUNCTION_EZU(10050,VG_Z_LIBC_SONAME,free)(ptrV); \ ++ if (ptrV != NULL) \ ++ VALGRIND_NON_SIMD_CALL1( info.tl_free, ptrV ); \ + MALLOC_TRACE(" = 0\n"); \ + return NULL; \ + } \ |