[compiler-rt] [win/asan] Ensure errno gets set correctly for strtol (PR #109258)

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 22 10:04:31 PDT 2024


================
@@ -650,9 +650,34 @@ static ALWAYS_INLINE auto StrtolImpl(void *ctx, Fn real, const char *nptr,
       return StrtolImpl(ctx, REAL(func), nptr, endptr, base);                \
     }
 
-INTERCEPTOR_STRTO_BASE(long, strtol)
 INTERCEPTOR_STRTO_BASE(long long, strtoll)
 
+#  if SANITIZER_WINDOWS
+INTERCEPTOR(long, strtol, const char *nptr, char **endptr, int base) {
+  // REAL(strtol) may be ntdll!strtol, which doesn't set errno. Instead,
----------------
zmodem wrote:

Ack.

https://github.com/llvm/llvm-project/pull/109258


More information about the llvm-commits mailing list