public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [google gcc-4_7, integration] Scribble on destructed strings to catch invalid accesses.
@ 2013-01-24  6:23 Paul Pluzhnikov
  2013-01-24 12:08 ` Diego Novillo
  2013-01-24 19:03 ` Marc Glisse
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Pluzhnikov @ 2013-01-24  6:23 UTC (permalink / raw)
  To: dnovillo, gcc-patches; +Cc: ppluzhnikov

This patch allows us to catch use of destructed strings.

Google ref: b/5430313

Ok for google/gcc-4_7 and google/integration?

--
Paul Pluzhnikov



Index: libstdc++-v3/include/ext/sso_string_base.h
===================================================================
--- libstdc++-v3/include/ext/sso_string_base.h	(revision 195417)
+++ libstdc++-v3/include/ext/sso_string_base.h	(working copy)
@@ -215,7 +215,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 			  const _Alloc& __a);
 
       ~__sso_string_base()
-      { _M_dispose(); }
+      {
+          _M_dispose();
+#ifdef __google_stl_debug_dangling_string
+          __builtin_memset(this, 0xcd, sizeof(*this));
+#endif
+      }
 
       _CharT_alloc_type&
       _M_get_allocator()

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-25 14:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-24  6:23 [google gcc-4_7, integration] Scribble on destructed strings to catch invalid accesses Paul Pluzhnikov
2013-01-24 12:08 ` Diego Novillo
2013-01-24 19:03 ` Marc Glisse
2013-01-25  0:15   ` Jonathan Wakely
2013-01-25 13:49     ` Diego Novillo
2013-01-25 14:52     ` Paul Pluzhnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).