develooper Front page | perl.perl5.changes | Postings from November 2010

[perl.git] branch blead, updated. v5.13.7-119-gbcc76ee

From:
Father Chrysostomos
Date:
November 26, 2010 14:39
Subject:
[perl.git] branch blead, updated. v5.13.7-119-gbcc76ee
Message ID:
E1PM6wW-0003x7-Ga@camel.ams6.corp.booking.com
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/bcc76ee34baf39636d60454c7d178f030ac755e3?hp=4c540399ef7fb5ef4e3a1dc7391da46f9d1c571c>

- Log -----------------------------------------------------------------
commit bcc76ee34baf39636d60454c7d178f030ac755e3
Author: Father Chrysostomos <sprout@cpan.org>
Date:   Fri Nov 26 14:24:30 2010 -0800

    [perl #78810] PERLDB_NOOPT ignored by adjacent nextstate optimisation
    
    As mentioned in the RT ticket, ac56e7d did not take PERLDB_NOOPT
    into account.
-----------------------------------------------------------------------

Summary of changes:
 ext/B/t/concise.t |   12 +++++++++++-
 op.c              |    2 +-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ext/B/t/concise.t b/ext/B/t/concise.t
index a6a1a78..b59701d 100644
--- a/ext/B/t/concise.t
+++ b/ext/B/t/concise.t
@@ -10,7 +10,7 @@ BEGIN {
     require 'test.pl';		# we use runperl from 'test.pl', so can't use Test::More
 }
 
-plan tests => 157;
+plan tests => 158;
 
 require_ok("B::Concise");
 
@@ -425,4 +425,14 @@ $out = runperl ( switches => ["-MO=Concise,-src,-stash=FOO,-main"],
 like($out, qr/FUNC: \*FOO::bar/,
      "stash rendering works on inlined package");
 
+# Test that consecutive nextstate ops are not nulled out when PERLDBf_NOOPT
+# is set.
+# XXX Does this test belong here?
+
+$out = runperl ( switches => ["-MO=Concise"],
+		 prog => 'BEGIN{$^P = 0x04} 1 if 0; print',
+		 stderr => 1 );
+like $out, qr/nextstate.*nextstate/s,
+  'nulling of nextstate-nextstate happeneth not when $^P | PERLDBf_NOOPT';
+
 __END__
diff --git a/op.c b/op.c
index 2115c66..5346a89 100644
--- a/op.c
+++ b/op.c
@@ -9317,7 +9317,7 @@ Perl_rpeep(pTHX_ register OP *o)
 	    /* Two NEXTSTATEs in a row serve no purpose. Except if they happen
 	       to carry two labels. For now, take the easier option, and skip
 	       this optimisation if the first NEXTSTATE has a label.  */
-	    if (!CopLABEL((COP*)o)) {
+	    if (!CopLABEL((COP*)o) && !PERLDB_NOOPT) {
 		OP *nextop = o->op_next;
 		while (nextop && nextop->op_type == OP_NULL)
 		    nextop = nextop->op_next;

--
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About