diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 index b5c679d2a8e..e6bc241a82e 100644 --- a/make/autoconf/jdk-options.m4 +++ b/make/autoconf/jdk-options.m4 @@ -441,6 +441,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER], elif test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then # -Oy- is equivalent to -fno-omit-frame-pointer in GCC/Clang. ASAN_CFLAGS="-fsanitize=address -Oy- -DADDRESS_SANITIZER" + ASAN_CFLAGS="$ASAN_CFLAGS -fsanitize-address-use-after-return" # MSVC produces a warning if you pass -fsanitize=address to the linker. It also complains $ if -DEBUG is not passed to the linker when building with ASan. ASAN_LDFLAGS="-debug"