From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-25 fe27e03: Fix rx matcher overflow without limiting Date: Mon, 14 Dec 2015 12:34:59 -0500 Message-ID: References: <20151214172513.19647.43539@vcs.savannah.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1450114532 14024 80.91.229.3 (14 Dec 2015 17:35:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Dec 2015 17:35:32 +0000 (UTC) Cc: Tassilo Horn To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 14 18:35:24 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a8X1v-0003Nw-I8 for ged-emacs-devel@m.gmane.org; Mon, 14 Dec 2015 18:35:23 +0100 Original-Received: from localhost ([::1]:32996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8X1u-0005YQ-Vo for ged-emacs-devel@m.gmane.org; Mon, 14 Dec 2015 12:35:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8X1h-0005XE-Fb for emacs-devel@gnu.org; Mon, 14 Dec 2015 12:35:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8X1g-0003iE-Na for emacs-devel@gnu.org; Mon, 14 Dec 2015 12:35:09 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:60733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8X1d-0003dS-25; Mon, 14 Dec 2015 12:35:05 -0500 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id tBEHZ0br021233; Mon, 14 Dec 2015 12:35:01 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 7C0EDAE520; Mon, 14 Dec 2015 12:34:59 -0500 (EST) In-Reply-To: (Tassilo Horn's message of "Mon, 14 Dec 2015 17:25:13 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5520=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5520> : inlines <4106> : streams <1554140> : uri <2101513> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:196251 Archived-At: > - "\\[[^][]\\{0,2000\\}\\ + ;; > + ;; If you think the first shy group is a bit strange, it is like > + ;; that in order not to overflow the regexp matcher stack in the > + ;; presence of unbalanced brackets, i.e., a [ and then no > + ;; closing bracket anymore. In "[^[],]*,", the "*" repetition > + ;; will be done without any need to record state for eventual > + ;; backtracking because the "," is mutually exclusive with the > + ;; "[^][,]", and the regexp matcher includes a special > + ;; optimization for that case since it's common and very > + ;; useful). (Hint by Stefan Monnier) > + "\\[\\(?:[^][,]*,\\)*[ \t]*\\