ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
[PATCH 20010902.002] parser panics on lvalue methods
by Rafael Garcia-Suarez other posts by this author
Nov 30 2001 10:46PM messages near this date
XS::Typemap gets linked in for static builds | Re: [PATCH 20010902.002] parser panics on lvalue methods
Here's a patch for bug ID 20010902.002. Actually, this is a
repost (augmented with a test !).

Shortly, the bug is a parser panic :

    $ perl -e '$x="y";main-> $x=1' 
    panic: unexpected optree near method call at -e line 1, at EOF
    Execution of -e aborted due to compilation errors.

With the patch :

    $ bperl -e '$x="y";main-> $x=1'
    Can't locate object method "y" via package "main" at -e line 1.


--- t/op/method.t.orig	Fri Jul  6 15:56:23 2001
+++ t/op/method.t	Fri Nov 30 23:27:50 2001
@@ -9,7 +9,7 @@
     @INC = '../lib';
 }
 
-print "1..72\n";
+print "1..73\n";
 
 @A::ISA = 'B';
 @B::ISA = 'C';
@@ -239,5 +239,14 @@
 #   print foo "bar"  where foo does not exist is an indirect object.
 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";
--- op.c.orig	Thu Nov 22 05:48:18 2001
+++ op.c	Fri Nov 30 23:16:56 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;
Thread:
Rafael Garcia-Suarez
Jarkko Hietaniemi

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved