]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
am_munmap_both_wrk: safely initialise out-param for all return paths.
authorJulian Seward <jseward@acm.org>
Wed, 8 Feb 2017 08:27:34 +0000 (08:27 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 8 Feb 2017 08:27:34 +0000 (08:27 +0000)
Silences what I think is a false complaint from gcc at -O3.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16221

coregrind/m_aspacemgr/aspacemgr-linux.c

index 907ceb774c94cc94489a2c568e062e6941195ae2..62bc1705805b59ed0b3a059461b8f61eb719344b 100644 (file)
@@ -2773,6 +2773,9 @@ SysRes am_munmap_both_wrk ( /*OUT*/Bool* need_discard,
    Bool   d;
    SysRes sres;
 
+   /* Be safe with this regardless of return path. */
+   *need_discard = False;
+
    if (!VG_IS_PAGE_ALIGNED(start))
       goto eINVAL;