This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Support -fsanitize=leak
- From: Dodji Seketeli <dodji at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>, Ian Lance Taylor <iant at google dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 22 Nov 2013 21:47:13 +0100
- Subject: Re: [PATCH] Support -fsanitize=leak
- Authentication-results: sourceware.org; auth=none
- References: <20131115194138 dot GQ892 at tucnak dot redhat dot com>
Jakub Jelinek <jakub@redhat.com> writes:
> This patch adds support for -fsanitize=leak and -static-liblsan options.
> If combined with -fsanitize=address, it does nothing,
>From this hunk:
@@ -8123,7 +8133,10 @@ sanitize_spec_function (int argc, const
return (flag_sanitize & SANITIZE_THREAD) ? "" : NULL;
if (strcmp (argv[0], "undefined") == 0)
return (flag_sanitize & SANITIZE_UNDEFINED) ? "" : NULL;
-
+ if (strcmp (argv[0], "leak") == 0)
+ return ((flag_sanitize
+ & (SANITIZE_ADDRESS | SANITIZE_LEAK | SANITIZE_THREAD))
+ == SANITIZE_LEAK) ? "" : NULL;
return NULL;
}
I'd say if combined with -fsanitize={address,thread} it does nothing,
right?
I'd say this needs some tests as well, but I guess they are coming a
bit later in the cycle?
[...]
> On Fri, Nov 15, 2013 at 12:34:14PM -0800, Ian Lance Taylor wrote:
>> Documentation?
>
> Here it is, as incremental patch:
>
> 2013-11-18 Jakub Jelinek <jakub@redhat.com>
>
> * doc/invoke.texi (-static-liblsan, -fsanitize=leak): Document.
[...]
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
Yes, this is OK with the incremental patch for the documentation.
Thanks.
--
Dodji