From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D6B23398B16F; Tue, 9 Feb 2021 20:55:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6B23398B16F From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/98575] [11 regression] False -Wanalyzer-malloc-leak on code path involving unknown function call Date: Tue, 09 Feb 2021 20:55:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 20:55:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98575 --- Comment #6 from CVS Commits --- The master branch has been updated by David Malcolm : https://gcc.gnu.org/g:790a8e8942b3f5a896ab5897cd209de1d9c382ae commit r11-7156-g790a8e8942b3f5a896ab5897cd209de1d9c382ae Author: David Malcolm Date: Tue Feb 9 15:54:14 2021 -0500 analyzer: support "_IO_"-prefixed variants of FILE * fns [PR98575] PR analyzer/98575 describes an unexpected -Wanalyzer-malloc-leak false positive from gcc.dg/analyzer/pr94851-1.c on glibc < 2.28. The issue is that a getchar call gets inlined into a call to _IO_getc, and "_IO_getc" is not in the set of FILE * functions the analyzer "knows about". This exposes a bug in memory leak detection on code paths in which an unknown function has been called. The memory leak bug is fixed in the prior commit, but for good measure this patch special-cases the "_IO_"-prefixed names in glibc so that the analyzer can reuse its knowledge about the unprefixed variants. gcc/analyzer/ChangeLog: PR analyzer/98575 * sm-file.cc (is_file_using_fn_p): Support "_IO_"-prefixed variants. gcc/testsuite/ChangeLog: PR analyzer/98575 * gcc.dg/analyzer/file-1.c (test_5): New. * gcc.dg/analyzer/file-3.c: New test.=