diff --git a/clang/docs/AddressSanitizer.rst b/clang/docs/AddressSanitizer.rst --- a/clang/docs/AddressSanitizer.rst +++ b/clang/docs/AddressSanitizer.rst @@ -14,8 +14,9 @@ * Out-of-bounds accesses to heap, stack and globals * Use-after-free -* Use-after-return (runtime flag `ASAN_OPTIONS=detect_stack_use_after_return=1`) -* Use-after-scope (clang flag `-fsanitize-address-use-after-scope`) +* Use-after-return (clang flag ``-fsanitize-address-use-after-return=(always|runtime|never)`` default: ``runtime``) + * Enable ``runtime`` with: ``ASAN_OPTIONS=detect_stack_use_after_return=1`` +* Use-after-scope (clang flag ``-fsanitize-address-use-after-scope``) * Double-free, invalid free * Memory leaks (experimental) diff --git a/clang/docs/ClangCommandLineReference.rst b/clang/docs/ClangCommandLineReference.rst --- a/clang/docs/ClangCommandLineReference.rst +++ b/clang/docs/ClangCommandLineReference.rst @@ -881,6 +881,15 @@ * ``global`` - Emit module destructors that are called via a platform specific array (see `llvm.global_dtors`). * ``none`` - Do not emit module destructors. +.. option:: -fsanitize-address-use-after-return= + +Select the enabling method of detecting stack use-after-return in AddressSanitizer. + +Valid options are: +* ``always`` - Detect use-after-return. +* ``runtime`` - Detect use-after-return with runtime ON/OFF switch (environment variable `ASAN_OPTIONS=detect_stack_use_after_return=1`, default: 0) +* ``never`` - Do not detect use-after-return. + .. option:: -fsanitize-ignorelist= Path to ignorelist file for sanitizers