This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Do not put gimple stmt on an abnormal edge (PR sanitizer/82545).


On Mon, Oct 16, 2017 at 10:15:04PM +0200, Martin Liška wrote:
> Hi.
> 
> As discussed with Jakub on IRC, we should not put ASAN reporting function
> on critical edges. Can that potentially lead to a missed use-after-scope,
> but I guess it's very rare.
> 
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
> 
> Thanks,
> Martin
> 
> gcc/ChangeLog:
> 
> 2017-10-16  Martin Liska  <mliska@suse.cz>
> 
> 	PR sanitizer/82545
> 	* asan.c (asan_expand_poison_ifn): Do not put gimple stmt
> 	on an abnormal edge.
> 
> gcc/testsuite/ChangeLog:
> 
> 2017-10-16  Martin Liska  <mliska@suse.cz>
> 
> 	PR sanitizer/82545
> 	* gcc.dg/asan/pr82545.c: New test.

Ok, with a nit:

> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/asan/pr82545.c
> @@ -0,0 +1,15 @@
> +/* PR sanitizer/82545.  */
> +/* { dg-do compile } */
> +
> +extern void c(int);
> +extern void d(void);
> +
> +void a(void) {
> +  {
> +    int b;
> +    &b;
> +    __builtin_setjmp(0);

Please call __builtin_setjmp with a valid argument in a global var,
like:
void *buf[5];
...
    __builtin_setjmp(buf);

> +    c(b);
> +  }
> +  d();
> +}
> 


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]