From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 436BD3888C42 for ; Wed, 23 Mar 2022 22:24:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 436BD3888C42 Received: by mail-wr1-x42d.google.com with SMTP id r7so3008009wrc.0 for ; Wed, 23 Mar 2022 15:24:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=f6pDvdid4EeSWKFY+oW3Kz2D+AzswXwPgV2KHKmqc+Y=; b=cSxMc+FbLxg+C0p5muxtbKgz6buozfLNdRLzwdqBoo7Txq+QaMVOxkngY/VDkp8PcS M+GgxAsK7opU5pMHnu6AMALeod1mQdfabjV1c8+bqRE4YhfC58k32iEOEv7CW66Vux1R T+Vg5GWl12/Q5YDc74U8EP07Sd+Vuq068AnibCsOhQKG88+B5wOtfEWfaqsn06JsZ1XB l9Fih5VRlVUbmope+Qg0vIw8IMjUs++H/bwb6edwa7gZZBfW7GFK5fcjoxUHmp4CNiWX PEaOMKkZ1WJmAlcsSuCjC3VTnslhjm91QTrkwr0J337sJdIKFt0wv+Z8v0lzW0yBuOCi L+WA== X-Gm-Message-State: AOAM532diucPGlpRw9h4FNChfvY5+03h5TavQKjKQI2f4Z1pg++oYGrt ku8+P/6L+Z0ycMzSnq9UAr8jO6k71e5D9Q== X-Google-Smtp-Source: ABdhPJz0dweUWcn700CPdaguaLnYjpicxltHM5H8Tutu2vYmWTV2Rj7P8h1B4Aj68c++Y3KOYWaN1A== X-Received: by 2002:a05:6000:1541:b0:204:18a5:5195 with SMTP id 1-20020a056000154100b0020418a55195mr1891711wry.148.1648074264031; Wed, 23 Mar 2022 15:24:24 -0700 (PDT) Received: from google.com (110.121.148.146.bc.googleusercontent.com. [146.148.121.110]) by smtp.gmail.com with ESMTPSA id p14-20020a5d59ae000000b00203dcc87d39sm1382225wrr.54.2022.03.23.15.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 15:24:23 -0700 (PDT) Date: Wed, 23 Mar 2022 23:24:20 +0100 From: "Steinar H. Gunderson" To: Nick Clifton Cc: binutils@sourceware.org, sesse@chromium.org Subject: Re: [PATCH] Add a trie to map quickly from address range to compilation unit. Message-ID: References: <20220321094030.1256430-1-sesse@google.com> <63191455-2374-5db9-f55e-ddf794c7d88e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <63191455-2374-5db9-f55e-ddf794c7d88e@redhat.com> X-Spam-Status: No, score=-19.1 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2022 22:24:27 -0000 On Wed, Mar 23, 2022 at 02:14:31PM +0000, Nick Clifton wrote: > This patch appears to introduce some new failures into the various testsuites. I found the issue; I had swapped the linenumber_ptr and discriminator_ptr in the two calls to comp_unit_find_nearest_narrowest_line(). Fixing that makes the test suite pass. But I noticed something else that's probably not good in the existing code; the “found” variable leaks out of the loop from the last iteration (only). So if you find a match without a line number of the second-to-last compilation unit but not in the last, found = false on return, but if you find a similar match in the last compilation unit, found = true. I suppose this isn't intentional, but what is the intention? Should there be a “found = false;” before the test on *linenumber_ptr? /* Steinar */