public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/redhat/heads/gcc-8-branch)] testsuite/98002 - fix gcc.dg/strncmp-2.c
@ 2021-04-23 10:22 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-04-23 10:22 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6724d053925c4dccc7f4dd7f4fb38f4b62020c6f

commit 6724d053925c4dccc7f4dd7f4fb38f4b62020c6f
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Nov 26 10:07:06 2020 +0100

    testsuite/98002 - fix gcc.dg/strncmp-2.c
    
    This makes sure not to free() memory we have mprotected to PROT_NONE
    by calling mprotect again with PROT_READ|PROT_WRITE.  This avoids
    crashing the allocator when in debug mode.
    
    2020-11-16  Richard Biener  <rguenther@suse.de>
    
            PR testsuite/98002
            * gcc.dg/strncmp-2.c: Call mprotect again before free.
    
    (cherry picked from commit 5b3a8fad18324cd38c221bdb0ae2b690fc82ede0)

Diff:
---
 gcc/testsuite/gcc.dg/strncmp-2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/testsuite/gcc.dg/strncmp-2.c b/gcc/testsuite/gcc.dg/strncmp-2.c
index f5555ba4081..40a4f501448 100644
--- a/gcc/testsuite/gcc.dg/strncmp-2.c
+++ b/gcc/testsuite/gcc.dg/strncmp-2.c
@@ -40,6 +40,7 @@ static void test_driver_strncmp (void (test_strncmp)(const char *, const char *,
     e = lib_memcmp(buf1,p2,sz);
     (*test_memcmp)(buf1,p2,e);
   }
+  mprotect (buf2+pgsz,pgsz,PROT_READ|PROT_WRITE);
   free(buf2);
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-23 10:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 10:22 [gcc(refs/vendors/redhat/heads/gcc-8-branch)] testsuite/98002 - fix gcc.dg/strncmp-2.c Jakub Jelinek

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).