From patchwork Thu Mar 17 22:40:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 1606798 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=ZCzkfUQn; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KKMYh2ytwz9s3q for ; Fri, 18 Mar 2022 09:40:55 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 973FA3857815 for ; Thu, 17 Mar 2022 22:40:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 973FA3857815 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1647556852; bh=boxDRQbLiPBFWQJTm3i3Zi3Ds1LtUYrcc3HoaZMKzmE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ZCzkfUQnPQUWrQazP+KV8QjrNDfjaV+VHkV6b0mLezjWI/VeIPHHq7HkP6Sr6Srx7 nKnTr6RYzK0e7yChIZESTjxk0qEBrjOpS/PmYkmfUYohiVXzStrVMKrTk8wIPhL1my 8rqqhVWd1YB2hqfJVjWKSKLfAJRzOh/PPnXadr/0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 678B93857C49 for ; Thu, 17 Mar 2022 22:40:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 678B93857C49 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-343-7QXsYrD4Pvm_06ZodQJ2ZQ-1; Thu, 17 Mar 2022 18:40:07 -0400 X-MC-Unique: 7QXsYrD4Pvm_06ZodQJ2ZQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 374CA18A6581 for ; Thu, 17 Mar 2022 22:40:07 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.2.17.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 167381400E6F; Thu, 17 Mar 2022 22:40:07 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [committed] analyzer: fix program_point::get_next for PK_BEFORE_STMT Date: Thu, 17 Mar 2022 18:40:05 -0400 Message-Id: <20220317224005.4160168-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: David Malcolm via Gcc-patches From: David Malcolm Reply-To: David Malcolm Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-7694-g2b3404357a1f99. gcc/analyzer/ChangeLog: * program-point.cc (program_point::get_next): Fix missing increment of index. Signed-off-by: David Malcolm --- gcc/analyzer/program-point.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/analyzer/program-point.cc b/gcc/analyzer/program-point.cc index 5318dce1490..9e264b14735 100644 --- a/gcc/analyzer/program-point.cc +++ b/gcc/analyzer/program-point.cc @@ -645,7 +645,7 @@ program_point::get_next () const return after_supernode (get_supernode (), get_call_string ()); case PK_BEFORE_STMT: { - unsigned next_idx = get_stmt_idx (); + unsigned next_idx = get_stmt_idx () + 1; if (next_idx < get_supernode ()->m_stmts.length ()) return before_stmt (get_supernode (), next_idx, get_call_string ()); else