Change 13404 by jhi@alpha on 2001/12/01 15:55:51

        Subject: [PATCH 20010902.002] parser panics on lvalue methods 
        From: Rafael Garcia-Suarez <[EMAIL PROTECTED]>
        Date: Fri, 30 Nov 2001 23:46:58 +0100
        Message-ID: <20011130234658.A717@rafael>

Affected files ...

.... //depot/perl/op.c#455 edit
.... //depot/perl/t/op/method.t#19 edit

Differences ...

==== //depot/perl/op.c#455 (text) ====
Index: perl/op.c
--- perl/op.c.~1~       Sat Dec  1 09:00:06 2001
+++ perl/op.c   Sat Dec  1 09:00:06 2001
@@ -1446,11 +1446,6 @@
                        || kid->op_type == OP_METHOD)
                    {
                        UNOP *newop;
-
-                       if (kid->op_sibling || kid->op_next != kid) {
-                           yyerror("panic: unexpected optree near method call");
-                           break;
-                       }
                        
                        NewOp(1101, newop, 1, UNOP);
                        newop->op_type = OP_RV2CV;

==== //depot/perl/t/op/method.t#19 (xtext) ====
Index: perl/t/op/method.t
--- perl/t/op/method.t.~1~      Sat Dec  1 09:00:06 2001
+++ perl/t/op/method.t  Sat Dec  1 09:00:06 2001
@@ -9,7 +9,7 @@
     @INC = '../lib';
 }
 
-print "1..72\n";
+print "1..73\n";
 
 @A::ISA = 'B';
 @B::ISA = 'C';
@@ -240,4 +240,13 @@
 eval { sub AUTOLOAD { "ok ", shift, "\n"; } };
 print nonsuch(++$cnt);
 
+# Bug ID 20010902.002
+test (
+    eval q[
+       $x = 'x';
+       sub Foo::x : lvalue { $x }
+       Foo->$x = 'ok';
+    ] || $@, 'ok'
+);
+
 print "# $cnt tests completed\n";
End of Patch.

Reply via email to