From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michal Nazarewicz Newsgroups: gmane.emacs.bugs Subject: bug#24100: [PATCH 1/4] Remove dead opcodes in regex bytecode Date: Thu, 28 Jul 2016 20:07:14 +0200 Message-ID: <1469729237-14208-1-git-send-email-mina86@mina86.com> References: <1469725228-24151-1-git-send-email-mina86@mina86.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1469729312 22164 80.91.229.3 (28 Jul 2016 18:08:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jul 2016 18:08:32 +0000 (UTC) To: 24100@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 28 20:08:25 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1bSpjM-00013P-Pu for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jul 2016 20:08:25 +0200 Original-Received: from localhost ([::1]:54951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSpjG-0005Rw-JB for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jul 2016 14:08:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSpj5-0005NV-1r for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2016 14:08:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSpj0-0007s1-Pq for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2016 14:08:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSpj0-0007rv-M0 for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2016 14:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bSpj0-0007kX-C6 for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2016 14:08:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <1469725228-24151-1-git-send-email-mina86@mina86.com> Resent-From: Michal Nazarewicz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Jul 2016 18:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24100 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24100-submit@debbugs.gnu.org id=B24100.146972924729717 (code B ref 24100); Thu, 28 Jul 2016 18:08:02 +0000 Original-Received: (at 24100) by debbugs.gnu.org; 28 Jul 2016 18:07:27 +0000 Original-Received: from localhost ([127.0.0.1]:49563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSpiQ-0007j9-VM for submit@debbugs.gnu.org; Thu, 28 Jul 2016 14:07:27 -0400 Original-Received: from mail-wm0-f54.google.com ([74.125.82.54]:38097) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSpiP-0007is-UV for 24100@debbugs.gnu.org; Thu, 28 Jul 2016 14:07:26 -0400 Original-Received: by mail-wm0-f54.google.com with SMTP id o80so119614172wme.1 for <24100@debbugs.gnu.org>; Thu, 28 Jul 2016 11:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:subject:date:message-id; bh=NPbFwOF0vI2AyIr1N/tjnvlLADUGaP/CpcKDbDz5J9M=; b=TbJNqxig6R8R3NvxTCfZoDJYXNklJP9U6jtXz8pVd8lYXpnhiKx9qLsJQH9TtW7NIN YMF0Kbu8qMdIYDEkISpiXe+OQm/AC7wCX/skJcuX+gTC4Wg0TfKmc09OsaQWRRUOEF7c 8QmHiWUG3gpoUZ9+zOQVZlb6lBjM3kfqQ1gX4XTfE58PDV7ww6iEVXhQEGjPHRHpcdfA G9iHVryHf5XIbFbne9HK0mYW7CyM2gwvC70pcAd1iLxmfInfUtUHCaO7iVeBBEmAniEp H/DXFJk06ZeG1Oc+5DzW9oMAX3yRZMJghChwKSAVfzxXE2NGuFtrPjM/HVrBUBO20rTJ b4aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id; bh=NPbFwOF0vI2AyIr1N/tjnvlLADUGaP/CpcKDbDz5J9M=; b=OB8qHzjCWlHTtj/MOORzCYN2BFJEladPMwr5eG7WRvH8QQ3CpTt+t7ktykIvY/TVfs 1VeB+ltgbny36eRyXdqAEx/Ex4AlF4PhtDh+9Q56Zdk3xCFg5pu3mZO0Ic8uEax3qqNP 0wnPyHj5qkHfXVPum1q7q+bTq0IigFzgrMe/hyma9wuGPC0lmM+97E0CRZifXuRXjAhD PEEGp0zZJ/aJJJAbftiHDq+Uxwq+5LQCdzY89Cr4a0jAN0KXKrH7BEhhpqvzZMQ5W32b NPb1xhQBjnReGOY/oavK0fWTfDqc0u5Jo8H9QogLzNJ17aoHzi/PqwpKY4DB8IgC1hWx 4EAA== X-Gm-Message-State: ALyK8tKGALek6Cju3FSo38rT7IzCe+o+a9dtOjoY5zK7DcVP0AXVHX0LtzTIm8iQPe74c19c X-Received: by 10.28.27.143 with SMTP id b137mr63622559wmb.12.1469729240003; Thu, 28 Jul 2016 11:07:20 -0700 (PDT) Original-Received: from mpn.zrh.corp.google.com ([172.16.113.135]) by smtp.gmail.com with ESMTPSA id d8sm13400293wmi.0.2016.07.28.11.07.19 for <24100@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jul 2016 11:07:19 -0700 (PDT) Original-Received: by mpn.zrh.corp.google.com (Postfix, from userid 126942) id 9C8D31E35E5; Thu, 28 Jul 2016 20:07:18 +0200 (CEST) X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 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: 208.118.235.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:121639 Archived-At: There is no way to specify before_dot and after_dot opcodes in a regex so code handling those ends up being dead. Remove it. * src/regex.c (print_partial_compiled_pattern, regex_compile, analyze_first, re_match_2_internal): Remove handling and references to before_dot and after_dot opcodes. --- src/regex.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/regex.c b/src/regex.c index 3a25835..261d299 100644 --- a/src/regex.c +++ b/src/regex.c @@ -669,9 +669,7 @@ typedef enum notsyntaxspec #ifdef emacs - ,before_dot, /* Succeeds if before point. */ - at_dot, /* Succeeds if at point. */ - after_dot, /* Succeeds if after point. */ + , at_dot, /* Succeeds if at point. */ /* Matches any character whose category-set contains the specified category. The operator is followed by a byte which contains a @@ -1053,18 +1051,10 @@ print_partial_compiled_pattern (re_char *start, re_char *end) break; # ifdef emacs - case before_dot: - fprintf (stderr, "/before_dot"); - break; - case at_dot: fprintf (stderr, "/at_dot"); break; - case after_dot: - fprintf (stderr, "/after_dot"); - break; - case categoryspec: fprintf (stderr, "/categoryspec"); mcnt = *p++; @@ -3440,8 +3430,6 @@ regex_compile (const_re_char *pattern, size_t size, reg_syntax_t syntax, goto normal_char; #ifdef emacs - /* There is no way to specify the before_dot and after_dot - operators. rms says this is ok. --karl */ case '=': laststart = b; BUF_PUSH (at_dot); @@ -4018,9 +4006,7 @@ analyze_first (const_re_char *p, const_re_char *pend, char *fastmap, /* All cases after this match the empty string. These end with `continue'. */ - case before_dot: case at_dot: - case after_dot: #endif /* !emacs */ case no_op: case begline: @@ -6148,24 +6134,12 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, break; #ifdef emacs - case before_dot: - DEBUG_PRINT ("EXECUTING before_dot.\n"); - if (PTR_BYTE_POS (d) >= PT_BYTE) - goto fail; - break; - case at_dot: DEBUG_PRINT ("EXECUTING at_dot.\n"); if (PTR_BYTE_POS (d) != PT_BYTE) goto fail; break; - case after_dot: - DEBUG_PRINT ("EXECUTING after_dot.\n"); - if (PTR_BYTE_POS (d) <= PT_BYTE) - goto fail; - break; - case categoryspec: case notcategoryspec: { -- 2.8.0.rc3.226.g39d4020