From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#41520: 28.0.50; Crash in character.h due to assertion error Date: Sun, 27 Sep 2020 16:36:21 +0200 Message-ID: <87wo0f1e3e.fsf@gnus.org> References: <83imgkw11q.fsf@gnu.org> <837dx0vysk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2581"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 41520@debbugs.gnu.org, stefan@marxist.se, Pip Cet To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 27 16:37:31 2020 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 1kMXnu-0000VA-Lv for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Sep 2020 16:37:30 +0200 Original-Received: from localhost ([::1]:44004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMXnt-0000vA-DS for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Sep 2020 10:37:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMXnS-0000uy-5u for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2020 10:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38578) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMXnR-0004YI-Pp for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2020 10:37:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMXnR-0005Yt-MQ for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2020 10:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Sep 2020 14:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41520 X-GNU-PR-Package: emacs Original-Received: via spool by 41520-submit@debbugs.gnu.org id=B41520.160121739421342 (code B ref 41520); Sun, 27 Sep 2020 14:37:01 +0000 Original-Received: (at 41520) by debbugs.gnu.org; 27 Sep 2020 14:36:34 +0000 Original-Received: from localhost ([127.0.0.1]:50124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMXmz-0005YA-KW for submit@debbugs.gnu.org; Sun, 27 Sep 2020 10:36:33 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:38524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMXmy-0005Xw-6J for 41520@debbugs.gnu.org; Sun, 27 Sep 2020 10:36:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; 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=kMNE2wpqoA5+KA6zctv8d/ay0j7TgwcSdA4d/uR7ep8=; b=E5/RAXI3kY/vuCuB9sHtyg0WjW wqOIyIpPLMmTrweu4AlwzvIRaRbscfs/vwqzhUexrauZhDJ4lGsxqu2Y6KxVndjMnYtYisjYtMQcS 29kQNAxJufjDYUQhO03dkJ6oN3NVg9SnJSu9Jw+D9JM/nFwK4h5XMCd6pnmZ78+zqCJ0=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMXmo-0005Oo-Jt; Sun, 27 Sep 2020 16:36:25 +0200 X-Now-Playing: Anohni's _Hopelessness_: "Why Did You Separate Me From The Earth?" In-Reply-To: <837dx0vysk.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 25 May 2020 18:07:07 +0300") 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" Xref: news.gmane.io gmane.emacs.bugs:189132 Archived-At: Eli Zaretskii writes: >> I'm attaching a patch with a few more cases. I don't have a strong >> preference for either FETCH_BYTE or FETCH_CHAR where both will do, but >> we should be consistent. > > I'm okay with those additional changes, but let's install them on > master, as they are a cleanup, not a bug. Pip's patch from May no longer applies cleanly, so I've respun it for the trunk now. Does this still look OK? diff --git a/src/cmds.c b/src/cmds.c index 90526612b7..c29cf00dad 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -390,7 +390,7 @@ internal_self_insert (int c, EMACS_INT n) by spaces so that the remaining text won't move. */ ptrdiff_t actual = PT_BYTE; actual -= prev_char_len (actual); - if (FETCH_CHAR (actual) == '\t') + if (FETCH_BYTE (actual) == '\t') /* Rather than add spaces, let's just keep the tab. */ chars_to_delete--; else diff --git a/src/syntax.c b/src/syntax.c index 066972e6d8..cbef61dfbe 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -731,7 +731,6 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, { rarely_quit (++quit_count); - ptrdiff_t temp_byte; int prev_syntax; bool com2start, com2end, comstart; @@ -882,8 +881,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, if (open_paren_in_column_0_is_defun_start && NILP (Vcomment_use_syntax_ppss) && (from == stop - || (temp_byte = dec_bytepos (from_byte), - FETCH_CHAR (temp_byte) == '\n'))) + || (FETCH_BYTE (from_byte - 1) == '\n'))) { defun_start = from; defun_start_byte = from_byte; diff --git a/src/xdisp.c b/src/xdisp.c index 3d40878be6..ecd23e0d0f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10619,7 +10619,7 @@ DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_siz while (bpos > BEGV_BYTE) { dec_both (&start, &bpos); - c = FETCH_CHAR (bpos); + c = FETCH_BYTE (bpos); if (!(c == ' ' || c == '\t')) break; } @@ -10641,7 +10641,7 @@ DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_siz while (bpos > BEGV_BYTE) { dec_both (&end, &bpos); - c = FETCH_CHAR (bpos); + c = FETCH_BYTE (bpos); if (!(c == ' ' || c == '\t' || c == '\n' || c == '\r')) break; } @@ -22277,7 +22277,7 @@ trailing_whitespace_p (ptrdiff_t charpos) int c = 0; while (bytepos < ZV_BYTE - && (c = FETCH_CHAR (bytepos), + && (c = FETCH_BYTE (bytepos), c == ' ' || c == '\t')) ++bytepos; -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no