From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BD4F386D601; Thu, 15 Feb 2024 21:02:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BD4F386D601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708030972; bh=fpcrGlWT8908I0bPhcdkijLv0G4onhfQLn5mm4v225I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KAZ/UwzL6UBX5W+kX9db6hxKcGQWtCsD1KRtywcygLVDRgOjQknVSOdN3P6xD+QuO YgeB9oCnRy48955mYVY6+xl++CK+rlZuhqjOSealytoLpcvDQealVnBdCJ1FoHIQZ3 aqYRfDNeHnhSVHOZigbigHAgCiwh/I987qslKRiI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/111266] [13/14 Regression] Missing -Wanalyzer-out-of-bounds for concrete offset overwrite. Date: Thu, 15 Feb 2024 21:02:51 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: vultkayn at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111266 --- Comment #2 from GCC Commits --- The master branch has been updated by David Malcolm : https://gcc.gnu.org/g:617bd59c659dcf6e5391409a2e9f64f75e905a96 commit r14-9018-g617bd59c659dcf6e5391409a2e9f64f75e905a96 Author: David Malcolm Date: Thu Feb 15 16:01:36 2024 -0500 analyzer: remove offset_region size overloads [PR111266] PR analyzer/111266 reports a missing -Wanalyzer-out-of-bounds when accessing relative to a concrete byte offset. Root cause is that offset_region::get_{byte,bit}_size_sval were attempting to compute the size that's valid to access, rather than the size of the access attempt. Fixed by removing these vfunc overrides from offset_region as the base class implementation does the right thing. gcc/analyzer/ChangeLog: PR analyzer/111266 * region.cc (offset_region::get_byte_size_sval): Delete. (offset_region::get_bit_size_sval): Delete. * region.h (region::get_byte_size): Add comment clarifying that this relates to the size of the access, rather than the size that's valid to access. (region::get_bit_size): Likewise. (region::get_byte_size_sval): Likewise. (region::get_bit_size_sval): Likewise. (offset_region::get_byte_size_sval): Delete. (offset_region::get_bit_size_sval): Delete. gcc/testsuite/ChangeLog: PR analyzer/111266 * c-c++-common/analyzer/out-of-bounds-pr111266.c: New test. Signed-off-by: David Malcolm =