pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Fixed the very stack-consuming ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/52e8a48825f2
branches:  trunk
changeset: 516149:52e8a48825f2
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Jul 15 06:57:51 2006 +0000

description:
Fixed the very stack-consuming regular expression regex_varassign so
that it only needs 256 kB of stack memory instead of more than 2 MB.

See also http://rt.perl.org/rt3/Public/Bug/Display.html?id=39774

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r e20e45b66d01 -r 52e8a48825f2 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Fri Jul 14 23:19:15 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sat Jul 15 06:57:51 2006 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.646 2006/07/14 04:54:58 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.647 2006/07/15 06:57:51 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -1756,7 +1756,7 @@
 use constant regex_shellcmd    => qr"^\t(.*)$";
 use constant regex_unresolved  => qr"\$\{";
 use constant regex_validchars  => qr"[\011\040-\176]";
-use constant regex_varassign   => qr"^([-*+A-Z_a-z0-9.\${}\[]+?)\s*(=|\?=|\+=|:=|!=)\s*((?:\\#|[^#])*?)(?:\s*(#.*))?$";
+use constant regex_varassign   => qr"^([-*+A-Z_a-z0-9.\${}\[]+?)\s*(=|\?=|\+=|:=|!=)\s*((?:\\#|[^#]+)*?)(?:\s*(#.*))?$";
 use constant regex_sh_varassign        => qr"^([A-Z_a-z][0-9A-Z_a-z]*)=";
 
 # The following "constants" are often used in contexts where
@@ -5316,7 +5316,8 @@
        my ($allowed_targets) = ({});
        my ($substcontext) = PkgLint::SubstContext->new();
 
-       $opt_debug_trace and log_debug((@{$lines} != 0) ? $lines->[0]->fname : NO_FILE, NO_LINES, "checklines_mk()");
+       assert(@{$lines} != 0);
+       $opt_debug_trace and log_debug($lines->[0]->fname, NO_LINES, "checklines_mk()");
 
        # Define global variables for the Makefile context.
        $mkctx_indentations = [0];



Home | Main Index | Thread Index | Old Index