diff options
| author | Vlad Tsyrklevich <vlad@tsyrklevich.net> | 2018-12-14 00:39:16 +0000 |
|---|---|---|
| committer | Vlad Tsyrklevich <vlad@tsyrklevich.net> | 2018-12-14 00:39:16 +0000 |
| commit | 137e23d536509103c7940ebb8c12332eb5031d83 (patch) | |
| tree | 0bbcf94414f2083971b5145053b578a1175f533b | |
| parent | 1f2b181689c8b938f2ec344179a86d3fbeaf0c74 (diff) | |
| download | bcm5719-llvm-137e23d536509103c7940ebb8c12332eb5031d83.tar.gz bcm5719-llvm-137e23d536509103c7940ebb8c12332eb5031d83.zip | |
Windows ASan: Instrument _msize_base()
Summary:
A recent update to the VS toolchain in chromium [1] broke the windows
ASan bot because the new toolchain calls _msize_base() instead of
_msize() in a number of _aligned_* UCRT routines. Instrument
_msize_base() as well.
[1] https://crbug.com/914947
Reviewers: rnk, #sanitizers, vitalybuka
Reviewed By: rnk, #sanitizers, vitalybuka
Subscribers: vitalybuka, kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D55684
llvm-svn: 349115
| -rw-r--r-- | compiler-rt/lib/asan/asan_malloc_win.cc | 6 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_win_dll_thunk.cc | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/asan_malloc_win.cc b/compiler-rt/lib/asan/asan_malloc_win.cc index a094e051cc2..88793643193 100644 --- a/compiler-rt/lib/asan/asan_malloc_win.cc +++ b/compiler-rt/lib/asan/asan_malloc_win.cc @@ -141,6 +141,11 @@ size_t _msize(void *ptr) { } ALLOCATION_FUNCTION_ATTRIBUTE +size_t _msize_base(void *ptr) { + return _msize(ptr); +} + +ALLOCATION_FUNCTION_ATTRIBUTE void *_expand(void *memblock, size_t size) { // _expand is used in realloc-like functions to resize the buffer if possible. // We don't want memory to stand still while resizing buffers, so return 0. @@ -235,6 +240,7 @@ void ReplaceSystemMalloc() { TryToOverrideFunction("_recalloc_base", (uptr)_recalloc); TryToOverrideFunction("_recalloc_crt", (uptr)_recalloc); TryToOverrideFunction("_msize", (uptr)_msize); + TryToOverrideFunction("_msize_base", (uptr)_msize); TryToOverrideFunction("_expand", (uptr)_expand); TryToOverrideFunction("_expand_base", (uptr)_expand); diff --git a/compiler-rt/lib/asan/asan_win_dll_thunk.cc b/compiler-rt/lib/asan/asan_win_dll_thunk.cc index c6a313d2402..df593ab92de 100644 --- a/compiler-rt/lib/asan/asan_win_dll_thunk.cc +++ b/compiler-rt/lib/asan/asan_win_dll_thunk.cc @@ -48,6 +48,7 @@ INTERCEPT_WRAP_W_WWW(_recalloc) INTERCEPT_WRAP_W_WWW(_recalloc_base) INTERCEPT_WRAP_W_W(_msize) +INTERCEPT_WRAP_W_W(_msize_base) INTERCEPT_WRAP_W_W(_expand) INTERCEPT_WRAP_W_W(_expand_dbg) |

