This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Document -fsanitize=vptr (PR sanitizer/64706)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 21 Jan 2015 22:33:47 +0100
- Subject: [PATCH] Document -fsanitize=vptr (PR sanitizer/64706)
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
I forgot to document this, is this ok for trunk or do you prefer some other
wording?
Slightly off-topic, what do you think about replacing *this ={v} {CLOBBER};
stmts in dtors of objects with virtual methods with storing of
NULL or some other value into the vtable pointer field, so that we would
(sometimes) catch member accesses and method calls after destruction?
2015-01-21 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/64706
* doc/invoke.texi (-fsanitize=vptr): Document.
--- gcc/doc/invoke.texi.jj 2015-01-20 11:51:41.000000000 +0100
+++ gcc/doc/invoke.texi 2015-01-21 12:49:14.679867871 +0100
@@ -5761,6 +5761,13 @@ This option enables instrumentation of l
a value outside the range of values for the enum type is loaded,
a run-time error is issued.
+@item -fsanitize=vptr
+@opindex fsanitize=vptr
+
+This option enables instrumentation of C++ member function calls, member
+accesses and some downcasts and upcasts, to verify the referenced object
+has the correct dynamic type.
+
@end table
While @option{-ftrapv} causes traps for signed overflows to be emitted,
Jakub