From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#63535: Master branch: Error in forw_comment (syntax.c) handling of escaped LFs Date: Wed, 17 May 2023 18:01:32 -0400 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20376"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 63535@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 18 00:02:26 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzPE2-00053p-HD for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 May 2023 00:02:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzPDh-00028B-AG; Wed, 17 May 2023 18:02:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzPDe-00027t-VU for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 18:02:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pzPDe-0000e2-M5 for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 18:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pzPDe-0005Na-5y for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 18:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 May 2023 22:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63535 X-GNU-PR-Package: emacs Original-Received: via spool by 63535-submit@debbugs.gnu.org id=B63535.168436090820655 (code B ref 63535); Wed, 17 May 2023 22:02:02 +0000 Original-Received: (at 63535) by debbugs.gnu.org; 17 May 2023 22:01:48 +0000 Original-Received: from localhost ([127.0.0.1]:51330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzPDP-0005N5-L8 for submit@debbugs.gnu.org; Wed, 17 May 2023 18:01:47 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzPDN-0005Mp-SE for 63535@debbugs.gnu.org; Wed, 17 May 2023 18:01:46 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 09559443697; Wed, 17 May 2023 18:01:40 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 51981443692; Wed, 17 May 2023 18:01:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1684360894; bh=zI/VteX/hqjNEsL+Z4kp8El6LOy8W4KdpBtEw51vpZg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=O+/fGnJ2ElN0SdDcR5Vpm/88Ahe5bRuI+7iDjuFIRi8bZeHPZGgykrSZqs1JchHze yJDgxptX94J40T+k1bxloHSBt1O3SP22rlqytp+xwR61nB+Z4+ZGU4Owt0mW8m+rw4 86+v85hvmjCsAKpJBYqzbbZWzgCFcJFf+p7aQ1CIBxIy0dQ9y0iyxx/sXQrYRjz2O7 gMj0HmaoX6DeTJWQpzeS+Wx/YpL81pTgvUU9SDk4k7MDWfg8VasTNfWbR6E7iotHkr OOzTBvvv+n84e6bd7F9KZtU1eZl1stKp5y1NRUURUFq/sMSaO8+S8/GPcROQINH6Iu Jqd40McwVBFkA== Original-Received: from pastel (unknown [45.72.217.176]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 21A3F1208FE; Wed, 17 May 2023 18:01:34 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Tue, 16 May 2023 14:03:18 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261888 Archived-At: Hi Alan, > diff --git a/src/syntax.c b/src/syntax.c > index e9e04e2d638..76d9f16e4ed 100644 > --- a/src/syntax.c > +++ b/src/syntax.c > @@ -2344,7 +2344,9 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, > && SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style > && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ? > (nesting > 0 && --nesting == 0) : nesting < 0) > - && !(comment_end_can_be_escaped && char_quoted (from, from_byte))) > + && !(comment_end_can_be_escaped && > + (((prev_syntax & 0xff) == Sescape) > + || ((prev_syntax & 0xff) == Scharquote)))) > /* We have encountered a comment end of the same style > as the comment sequence which began this comment > section. */ AFAIK this is your code, so you should know better, but AFAICT `prev_syntax` is not updated in the loop, so it only reflects the syntax before the beginning of the scanned text, rather than anything near `from`. Are you sure this is right? Stefan