From patchwork Sat May 9 18:56:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 6647 Received: (qmail 7747 invoked by alias); 9 May 2015 18:57:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 7738 invoked by uid 89); 9 May 2015 18:57:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_20, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-out.m-online.net Received: from mail-out.m-online.net (HELO mail-out.m-online.net) (212.18.0.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Sat, 09 May 2015 18:57:00 +0000 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3lkd6w4sQtz3hjTb for ; Sat, 9 May 2015 20:56:56 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3lkd6w31Q9zvjDh for ; Sat, 9 May 2015 20:56:56 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id c5z0TAd-ra5V for ; Sat, 9 May 2015 20:56:55 +0200 (CEST) X-Auth-Info: 2Ra903M1HChbLwYNo6YA1FK3I0xsitsiitpR+VbkwUFaMTRnCbfhd9x/FNtDgrKi Received: from igel.home (ppp-93-104-92-148.dynamic.mnet-online.de [93.104.92.148]) by mail.mnet-online.de (Postfix) with ESMTPA for ; Sat, 9 May 2015 20:56:55 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 47DEA2C0C67; Sat, 9 May 2015 20:56:55 +0200 (CEST) From: Andreas Schwab To: gdb-patches@sourceware.org Subject: [PATCH] Fix wrong assertions X-Yow: Was my SOY LOAF left out in th'RAIN? It tastes REAL GOOD!! Date: Sat, 09 May 2015 20:56:55 +0200 Message-ID: <87vbg1eg08.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Both callers and callees are lengths, and the sum of them can validly equal the total length. Andreas. PR symtab/18392 * dwarf2-frame-tailcall.c (pretended_chain_levels): Correct assertion. * dwarf2loc.c (chain_candidate): Likewise. --- gdb/dwarf2-frame-tailcall.c | 2 +- gdb/dwarf2loc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/dwarf2-frame-tailcall.c b/gdb/dwarf2-frame-tailcall.c index b412a5b..f964ab2 100644 --- a/gdb/dwarf2-frame-tailcall.c +++ b/gdb/dwarf2-frame-tailcall.c @@ -197,7 +197,7 @@ pretended_chain_levels (struct call_site_chain *chain) return chain->length; chain_levels = chain->callers + chain->callees; - gdb_assert (chain_levels < chain->length); + gdb_assert (chain_levels <= chain->length); return chain_levels; } diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index d811106..29b265b 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -827,7 +827,7 @@ chain_candidate (struct gdbarch *gdbarch, struct call_site_chain **resultp, PC again. In such case there must be two different code paths to reach it, therefore some of the former determined intermediate PCs must differ and the unambiguous chain gets shortened. */ - gdb_assert (result->callers + result->callees < result->length); + gdb_assert (result->callers + result->callees <= result->length); } /* Create and return call_site_chain for CALLER_PC and CALLEE_PC. All the