I see no other way how to make Clang ASAN work. ASAN recognizes first instruction(s) and inserts trampoline, but the loop in the function body jumps back to the start of the function (and hangs) or somewhere inside the trampoline (that leads to invalid instruction).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50993 Signed-off-by: Roman Pišl rpisl@seznam.cz --- dlls/msvcrt/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index d92b7a38d12..9fa8700da3d 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -1510,7 +1510,7 @@ int CDECL _atoldbl(_LDOUBLE *value, char *str) /********************************************************************* * strlen (MSVCRT.@) */ -size_t __cdecl strlen(const char *str) +size_t __cdecl DECLSPEC_HOTPATCH strlen(const char *str) { const char *s = str; while (*s) s++; @@ -3160,7 +3160,7 @@ char* __cdecl strchr(const char *str, int c) /********************************************************************* * strrchr (MSVCRT.@) */ -char* __cdecl strrchr(const char *str, int c) +char* __cdecl DECLSPEC_HOTPATCH strrchr(const char *str, int c) { char *ret = NULL; do { if (*str == (char)c) ret = (char*)str; } while (*str++);
I see no other way how to make Clang ASAN work. ASAN recognizes first instruction(s) and inserts trampoline, but the loop in the function body jumps back to the start of the function (and hangs) or somewhere inside the trampoline (that leads to invalid instruction).
Other fixes can be performed on the ASAN side, see the bug report.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50993 Signed-off-by: Roman Pišl rpisl@seznam.cz --- dlls/ntdll/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntdll/string.c b/dlls/ntdll/string.c index 0fa83821d21..e58320790cf 100644 --- a/dlls/ntdll/string.c +++ b/dlls/ntdll/string.c @@ -339,7 +339,7 @@ char * __cdecl strpbrk( const char *str, const char *accept ) /********************************************************************* * strrchr (NTDLL.@) */ -char * __cdecl strrchr( const char *str, int c ) +char * __cdecl DECLSPEC_HOTPATCH strrchr( const char *str, int c ) { char *ret = NULL; do { if (*str == (char)c) ret = (char *)(ULONG_PTR)str; } while (*str++);