From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93917 invoked by alias); 30 Nov 2018 18:19:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 93898 invoked by uid 89); 30 Nov 2018 18:19:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Nov 2018 18:19:15 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BCF364E92B; Fri, 30 Nov 2018 18:19:13 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id C95FA1948E; Fri, 30 Nov 2018 18:19:11 +0000 (UTC) Subject: Re: RFA/RFC: Add stack recursion limit to libiberty's demangler [v3] To: Nick Clifton , Jakub Jelinek , matz@gcc.gnu.org, sgayou@redhat.com, Ian Lance Taylor , Tom Tromey References: <87muprdko7.fsf@redhat.com> <20181130084211.GX12380@tucnak> <173817ca-0aa0-e1a2-6725-37e079ead545@redhat.com> <20181130140330.GA12380@tucnak> Cc: gcc-patches@gcc.gnu.org, binutils@sourceware.org, jason@redhat.com From: Pedro Alves Message-ID: <93ed75c0-9547-6fcf-8c04-85d2827d9264@redhat.com> Date: Fri, 30 Nov 2018 18:19:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-11/txt/msg02592.txt.bz2 On 11/30/2018 05:41 PM, Nick Clifton wrote: > @@ -4693,10 +4694,21 @@ > demangle_nested_args (struct work_stuff *work, const char **mangled, > string *declp) > { > + static unsigned long recursion_level = 0; > string* saved_previous_argument; > int result; > int saved_nrepeats; > > + if ((work->options & DMGL_RECURSE_LIMIT) > + && work->recursion_level > DEMANGLE_RECURSION_LIMIT) > + { > + /* FIXME: There ought to be a way to report that the recursion limit > + has been reached. */ > + return 0; > + } > + > + recursion_level ++; > + There's still a static recursion level counter here? Thanks, Pedro Alves