aboutsummaryrefslogtreecommitdiff
path: root/docs/AddressSanitizer.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/AddressSanitizer.rst')
-rw-r--r--docs/AddressSanitizer.rst9
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/AddressSanitizer.rst b/docs/AddressSanitizer.rst
index a42a1ff62377..ed28ad4de6ed 100644
--- a/docs/AddressSanitizer.rst
+++ b/docs/AddressSanitizer.rst
@@ -14,7 +14,8 @@ following types of bugs:
* Out-of-bounds accesses to heap, stack and globals
* Use-after-free
-* Use-after-return (to some extent)
+* Use-after-return (runtime flag `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)
@@ -48,16 +49,16 @@ you may need to disable inlining (just use ``-O1``) and tail call elimination
}
# Compile and link
- % clang -O1 -g -fsanitize=address -fno-omit-frame-pointer example_UseAfterFree.cc
+ % clang++ -O1 -g -fsanitize=address -fno-omit-frame-pointer example_UseAfterFree.cc
or:
.. code-block:: console
# Compile
- % clang -O1 -g -fsanitize=address -fno-omit-frame-pointer -c example_UseAfterFree.cc
+ % clang++ -O1 -g -fsanitize=address -fno-omit-frame-pointer -c example_UseAfterFree.cc
# Link
- % clang -g -fsanitize=address example_UseAfterFree.o
+ % clang++ -g -fsanitize=address example_UseAfterFree.o
If a bug is detected, the program will print an error message to stderr and
exit with a non-zero exit code. AddressSanitizer exits on the first detected error.