From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#36370: 27.0.50; XFIXNAT called on negative numbers Date: Tue, 25 Jun 2019 05:36:15 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000c7322b058c1f502e" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="104544"; mail-complaints-to="usenet@blaine.gmane.org" To: 36370@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 25 07:37:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfe8l-000R2O-FZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Jun 2019 07:37:11 +0200 Original-Received: from localhost ([::1]:56660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfe8k-00035g-DY for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Jun 2019 01:37:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40276) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfe8e-00035H-Bx for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 01:37:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfe8c-000625-N1 for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 01:37:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44980) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfe8c-00061h-Ib for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 01:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfe8c-0003Cl-Bg for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 01:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Jun 2019 05:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36370 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156144101912308 (code B ref -1); Tue, 25 Jun 2019 05:37:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Jun 2019 05:36:59 +0000 Original-Received: from localhost ([127.0.0.1]:58524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfe8Z-0003CQ-3f for submit@debbugs.gnu.org; Tue, 25 Jun 2019 01:36:59 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:48214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfe8W-0003CH-Lh for submit@debbugs.gnu.org; Tue, 25 Jun 2019 01:36:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40224) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfe8U-0002yo-Li for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 01:36:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfe8S-0005ps-Rb for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 01:36:54 -0400 Original-Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]:39851) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfe8S-0005ne-D2 for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 01:36:52 -0400 Original-Received: by mail-ot1-x329.google.com with SMTP id r21so16021780otq.6 for ; Mon, 24 Jun 2019 22:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=MlQpWSXzwIWZFeCflyF926jlJvPnwKt3XnvnMIIq6PI=; b=l9vV5Nx7aaVZw7WTyCvLYT2UFS9w/AfjZsnNQ3XV81g6JhSk60fMDyvQVkBVrGQ4If Mwa7SQzvbLy9z80wwVnsaVVikwuDINI1huUJUfsB/dONyTnVarq3T4dlfNUan/rgKNgR g4iYxUis7Wu6KVuCRSJiEg6URiYEt8NU5SEvMfkUhU4lFc92AmvPCPW1o1ABZNpMoEGe T28RUo0bphf7lNk97H2z3mcZW50qCVE6+cM8nBomYma4ko0OEIRAhglHOmC2jZ4OrTox eX2g9k9J4N5gKpTL6oRjdo3b5/ZHmPLnPW61rJCnaDKywhBP1JyLRNZrGp2K1KWj2/Qz W6yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=MlQpWSXzwIWZFeCflyF926jlJvPnwKt3XnvnMIIq6PI=; b=o89/GHJ3TbpPJznOD5cSPRo4a8ueg55UbLp7QULxGmwSwTTK8O60zw56sUTOTPEV+l pyZR8mGWXLYuZ5FHo9GDYoBjNpeAVHY4jX0QxW821Irtswk9miEIb1coTQHPTi9egdWs HfMkqNZQmyYUwVplxr3ZKjr2K/ry7KaHZE40mZdPH9MCyRKjCcd0w4QWlEcxPdjwmgXP kHedYeTYXu+7bJpb5wvY0tAMeI2FnPhN+T87xTlDUDR/+IWKze9o3fqJoK/3xwDIHmss pZl8zwIqg+stNM+ZgOKdqty2QpDdxyqgBV0Udi+ZlPFIhlCJawUxfjvQlZvsyxSdom/I Nvlw== X-Gm-Message-State: APjAAAX3PW6EPpTnx42tT9nBV5KKBGx5YmW0pwrWvTxtLhX6NbZIdRf+ DLzg0m2f12Ao0xSR6NOSoRQ+oSgvEBVzQFYvEaqPYpFv4Bw= X-Google-Smtp-Source: APXvYqy4g3qizFeI8jRsrTzvBAVmU9xmU7LYImnmF1J4fVExzff63i8MGOGD+BkxcxRmm8kwKHAFsqPit0BwSVSXkRQ= X-Received: by 2002:a9d:7352:: with SMTP id l18mr20350882otk.292.1561441010643; Mon, 24 Jun 2019 22:36:50 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161325 Archived-At: --000000000000c7322b058c1f502e Content-Type: text/plain; charset="UTF-8" I just spent some time reviewing the use of XFIXNAT, after being bitten by this code in fileio.c: if (FIXNUMP (tem)) nextpos = XFIXNAT (tem); In the following cases, negative numbers passed to APIs which aren't strictly internal or low-level cause us to call XFIXNAT on a negative number: (indent-to -100 -100) (set-text-properties -1 -1 nil "") (make-network-process :name "name" :family 'ipv6 :remote [-1 0 0 0 0 0 0 0 0]) (end-kbd-macro -1 nil) (previous-single-property-change (point) 'dummy nil -1) I think those six cases are worth fixing, but more generally, I think it would help avoid such errors if XFIXNAT were "always" paired with FIXNATP, XFIXNUM with FIXNUMP, and XCHARACTER (which would be new) with CHARACTERP. So I'm going to be brave here and admit that in many cases, while XFIXNUM was correct, it took me a long time to see that because the check was performed somewhere else. I understand there is a very slight performance hit on some platforms, but is that really still an issue? Also, consistent pairing would catch a few cases in which we call XFIXNUM but could get away with an XFIXNAT, such as this code in self-insert-command: if (!CHARACTERP (c)) bitch_at_user (); else { int character = translate_char (Vtranslation_table_for_input, XFIXNUM (c)); I also think it would make sense to eassume (FIXNUMP (a)) in both XFIXNAT and XFIXNUM (but not XHASH, or XUFIXNUM if that's what XHASH uses). It might catch bugs like (set-text-properties nil nil nil "") currently not throwing an error. The patch I'm attaching fixes only things I'm reasonably sure are bugs. --000000000000c7322b058c1f502e Content-Type: text/x-patch; charset="US-ASCII"; name="xfixnat.diff" Content-Disposition: attachment; filename="xfixnat.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jxbdl7wb0 ZGlmZiAtLWdpdCBhL3NyYy9jY2wuYyBiL3NyYy9jY2wuYwppbmRleCBlYzEwOGUzMGQ4Li5jODUz ZTYxOTgyIDEwMDY0NAotLS0gYS9zcmMvY2NsLmMKKysrIGIvc3JjL2NjbC5jCkBAIC0yMDYyLDcg KzIwNjIsNyBAQCAjZGVmaW5lIENDTF9FWEVDVVRFX0JVRl9TSVpFIDEwMjQKICAgICAgIGlmIChU WVBFX1JBTkdFRF9GSVhOVU1QIChpbnQsIEFSRUYgKHN0YXR1cywgaSkpKQogCWNjbC5yZWdbaV0g PSBYRklYTlVNIChBUkVGIChzdGF0dXMsIGkpKTsKICAgICB9Ci0gIGlmIChGSVhOVU1QIChBUkVG IChzdGF0dXMsIGkpKSkKKyAgaWYgKEZJWE5BVFAgKEFSRUYgKHN0YXR1cywgaSkpKQogICAgIHsK ICAgICAgIGkgPSBYRklYTkFUIChBUkVGIChzdGF0dXMsIDgpKTsKICAgICAgIGlmIChjY2wuaWMg PCBpICYmIGkgPCBjY2wuc2l6ZSkKZGlmZiAtLWdpdCBhL3NyYy9kb3NmbnMuYyBiL3NyYy9kb3Nm bnMuYwppbmRleCA0N2M1NDUwMDdhLi5mYjViY2M5YWQzIDEwMDY0NAotLS0gYS9zcmMvZG9zZm5z LmM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