From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116683 invoked by alias); 30 Nov 2018 20:42:21 -0000 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 Received: (qmail 116665 invoked by uid 89); 30 Nov 2018 20:42:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sooner X-HELO: gateway30.websitewelcome.com Received: from gateway30.websitewelcome.com (HELO gateway30.websitewelcome.com) (192.185.151.58) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Nov 2018 20:42:19 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway30.websitewelcome.com (Postfix) with ESMTP id B12B5D6FBA0 for ; Fri, 30 Nov 2018 14:42:18 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id SpcAgPmpIPvAdSpcAg55GP; Fri, 30 Nov 2018 14:42:18 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7mcVkjMxDwwHkJgZK4Z9spVR4OZq8sKW9Wf0mbN48x0=; b=SQ06EEFErJr8DjmKVCI7DHSEJs bbpdjMXpjTA9etDBt9hM+2TDhlX1gtSUECCmF+rEtBW82y9G5TcSteCXM3TCH4HfX6fPKp1/nQe2v +58DlA6S2VGaEK2ettKY2ZJJP; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:58648 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gSpcA-002D7V-Ey; Fri, 30 Nov 2018 14:42:18 -0600 From: Tom Tromey To: Pedro Alves Cc: Philippe Waroquiers , gdb-patches@sourceware.org Subject: Re: [PATCH] Merge forward-search/reverse-search, use gdb::def_vector, remove limit (Re: [RFA] Fix leak in forward-search) References: <20181127233328.5164-1-philippe.waroquiers@skynet.be> <3cf960b8-ff82-0670-fa90-c94d78573bfe@redhat.com> <1543532723.4149.7.camel@skynet.be> <6e8a2a00-bcbd-cdc6-f332-f59988bb8c40@redhat.com> Date: Fri, 30 Nov 2018 20:42:00 -0000 In-Reply-To: <6e8a2a00-bcbd-cdc6-f332-f59988bb8c40@redhat.com> (Pedro Alves's message of "Fri, 30 Nov 2018 19:43:36 +0000") Message-ID: <871s72mh5i.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-11/txt/msg00588.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> -/* FIXME!!! We walk right off the end of buf if we get a long line!!! */ I'm surprised all those exclamation marks didn't help us find this sooner. /s Pedro> I don't think there's much point in reusing the buffer across Pedro> command invocations. Agreed. Pedro> - msg = (char *) re_comp (regex); Pedro> + char *msg = (char *) re_comp (regex); Pre-existing, but I wonder why this cast is needed. I think "const char *msg" and removing the cast ought to be completely fine. Or (more work) avoid re_comp and use compiled_regex instead. The rest seems fine to me. Thank you for doing this. Tom