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#24071: [PATCH 6/7] Remove dead opcodes in regex bytecode Date: Wed, 27 Jul 2016 18:50:46 +0200 Message-ID: <1469638247-20131-6-git-send-email-mina86@mina86.com> References: <83d1m0tq25.fsf@gnu.org> <1469638247-20131-1-git-send-email-mina86@mina86.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1469638445 31307 80.91.229.3 (27 Jul 2016 16:54:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Jul 2016 16:54:05 +0000 (UTC) To: 24071@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 27 18:53:56 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 1bSS5k-0007SB-9f for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Jul 2016 18:53:56 +0200 Original-Received: from localhost ([::1]:47713 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSS5g-00054B-F9 for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Jul 2016 12:53:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSS43-00035b-SU for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2016 12:52:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSS3v-0003ZH-Ok for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2016 12:52:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSS3v-0003ZD-Lc for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2016 12:52:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bSS3v-0007u9-Gq for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2016 12:52:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michal Nazarewicz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Jul 2016 16:52:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24071 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24071-submit@debbugs.gnu.org id=B24071.146963826530284 (code B ref 24071); Wed, 27 Jul 2016 16:52:03 +0000 Original-Received: (at 24071) by debbugs.gnu.org; 27 Jul 2016 16:51:05 +0000 Original-Received: from localhost ([127.0.0.1]:39391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSS2y-0007sE-Gb for submit@debbugs.gnu.org; Wed, 27 Jul 2016 12:51:04 -0400 Original-Received: from mail-wm0-f43.google.com ([74.125.82.43]:37690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSS2u-0007qi-86 for 24071@debbugs.gnu.org; Wed, 27 Jul 2016 12:51:00 -0400 Original-Received: by mail-wm0-f43.google.com with SMTP id i5so71438374wmg.0 for <24071@debbugs.gnu.org>; Wed, 27 Jul 2016 09:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=X0x6qNUD/ei9JG110ErSTsWelEZuEUFqFoghci+Kwlc=; b=nDfPKJVwnnEg3ze1eH6o/3VwJYvTnUgDn1V+NZWR+xnjCTUaYqfMphF9SMFwW4EKHb sPmlRQbiMbXzqEKja9sh8sjP5UBmVMIr5sCkz6yUH0BAEz59SbAA1ekiB8qfOK19vjAA UzoU0BbesVDG2G7Mpkcx6W8QQeEkLrm6agMu7AJJYNMuu0HNIoRumGpnkz4a7T8Hap6Z 5YhnbWKr+apZIMS4fmOdfiaxAOCjAxNa9m5gtdASVyGYW6FTh2nnq1c8SbugNWir3pOa ma+a1EYYGmCKW6pdHmTNmh3fDmdOzYbF2KpArWJ5tdYWHy61LwOntXtqbxKtOYogD/ox Zdlw== 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:cc:subject:date:message-id :in-reply-to:references; bh=X0x6qNUD/ei9JG110ErSTsWelEZuEUFqFoghci+Kwlc=; b=VolAhJRMdg+2r0BDXQoCe7Wn0NTLK+uZlRQO4HxougRb6YoiYEw91A+MmO/FHOxO6I 7/gzpkXE94eVwK3UUBzx63NnWFoA6/4KTfLo/tp8zgLppTXHO1uZSKpmWyJmmz68RXBU EN969cd1FEBvEhnl356JHbzMqH5aP+29WWD5vOSckr5wwnakal2Xu+xEdQ7LO78soqwk lP2VODyaN31Z8173+GhzWZSHtkvf6U3LBodyihqlI8tULLblx5gY1T7S9c/SR+4erCbN 4MHdUt6gSkKQgmmAIXYIaBk/EvsyelAWhH8LlwEOS3PaMMjxyD5TGLbOgeeRMWK43omI 0RCA== X-Gm-Message-State: ALyK8tKj6VEANDqAbMPPbWOTaNjGhAr0XjxBt+URhsZgiX88u+s2nAKi3jsZQjFT3lp+KDZo X-Received: by 10.28.131.199 with SMTP id f190mr54335682wmd.30.1469638254170; Wed, 27 Jul 2016 09:50:54 -0700 (PDT) Original-Received: from mpn.zrh.corp.google.com ([2620:0:105f:301:2815:7585:2e57:6c3b]) by smtp.gmail.com with ESMTPSA id q4sm7263095wjk.24.2016.07.27.09.50.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jul 2016 09:50:53 -0700 (PDT) Original-Received: by mpn.zrh.corp.google.com (Postfix, from userid 126942) id 83FB31E35E8; Wed, 27 Jul 2016 18:50:50 +0200 (CEST) X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1469638247-20131-1-git-send-email-mina86@mina86.com> 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:121591 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 1f2a1f08..cca00e9 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++; @@ -3422,8 +3412,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); @@ -4000,9 +3988,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: @@ -6150,24 +6136,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