From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19759 invoked by alias); 22 Jul 2009 08:55:05 -0000 Received: (qmail 19745 invoked by uid 22791); 22 Jul 2009 08:55:04 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Jul 2009 08:54:55 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6M8spRQ004905; Wed, 22 Jul 2009 04:54:51 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6M8sojT030100; Wed, 22 Jul 2009 04:54:51 -0400 Received: from hase.home (sebastian-int.corp.redhat.com [172.16.52.221]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6M8snbH015054; Wed, 22 Jul 2009 04:54:50 -0400 From: Andreas Schwab To: ppluzhnikov@google.com (Paul Pluzhnikov) Cc: gdb-patches@sourceware.org Subject: Re: [patch] Speed up dwarf2_frame_find_fde References: <20090721223129.85D1F76BC0@localhost> X-Yow: .. this must be what it's like to be a COLLEGE GRADUATE!! Date: Wed, 22 Jul 2009 10:02:00 -0000 In-Reply-To: <20090721223129.85D1F76BC0@localhost> (Paul Pluzhnikov's message of "Tue, 21 Jul 2009 15:31:29 -0700 (PDT)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.96 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00533.txt.bz2 ppluzhnikov@google.com (Paul Pluzhnikov) writes: > +static int > +bsearch_cie_cmp (const void *key, const void *element) > +{ > + ULONGEST cie_pointer = *(ULONGEST *) key; > + struct dwarf2_cie *cie = *(struct dwarf2_cie **) element; > + return cie_pointer - cie->cie_pointer; This can overflow. > +static int > +qsort_fde_cmp (const void *a, const void *b) > +{ > + struct dwarf2_fde *aa = *(struct dwarf2_fde **)a; > + struct dwarf2_fde *bb = *(struct dwarf2_fde **)b; > + if (aa->initial_location == bb->initial_location) > + /* Put eh_frame entries after debug_frame ones. */ > + return aa->eh_frame_p - bb->eh_frame_p; > + > + return aa->initial_location - bb->initial_location; Likewise. Andreas. -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different."