Re: [PATCH replacement] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-20 Thread Piotr Fusik
gt; + $x = 1 for $[ = 0; gt; + pass('optimized assignment to $[ used to segfault in scalar context'); gt; + if (($[) = 0) { $x = 1 } gt; + pass('optimized assignment to $[ used to segfault in list context'); gt; gt; Looks like the descriptions of contexts are swapped (i.e. quot;forquot;

Re: [PATCH replacement] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-20 Thread Rafael Garcia-Suarez
Rick Delaney wrote: On Sun, Jun 19, 2005 at 11:34:55AM -, Piotr Fusik wrote: + $x = 1 for $[ = 0; + pass('optimized assignment to $[ used to segfault in scalar context'); + if (($[) = 0) { $x = 1 } + pass('optimized assignment to $[ used to segfault in list context'); Looks like

Re: [PATCH replacement] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-20 Thread Yitzchak Scott-Thoennes
On Mon, Jun 20, 2005 at 10:44:30AM -, Piotr Fusik wrote: gt; + $x = 1 for $[ = 0; gt; + pass('optimized assignment to $[ used to segfault in scalar context'); gt; + if (($[) = 0) { $x = 1 } gt; + pass('optimized assignment to $[ used to segfault in list context'); gt; gt; Looks

Re: [PATCH replacement] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-20 Thread Rick Delaney
On Mon, Jun 20, 2005 at 03:03:20AM -0700, Yitzchak Scott-Thoennes wrote: On Mon, Jun 20, 2005 at 10:44:30AM -, Piotr Fusik wrote: I thought the assignment is the = operator. So: for $[ = 0 is scalar assignment in list context. if (($[) = 0) is list assignment in scalar context. Am I

Re: [PATCH replacement] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-19 Thread Piotr Fusik
+ $x = 1 for $[ = 0; + pass('optimized assignment to $[ used to segfault in scalar context'); + if (($[) = 0) { $x = 1 } + pass('optimized assignment to $[ used to segfault in list context'); Looks like the descriptions of contexts are swapped (i.e. for should be list, if should be scalar).

Re: [PATCH replacement] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-19 Thread Rick Delaney
PROTECTED];'; like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '[EMAIL PROTECTED]' ); @@ -168,3 +168,25 @@ eval q{ sub _ __FILE__ {} }; like($@, qr/Illegal declaration of subroutine main::_/, __FILE__ as prototype); } + +# [perl #36313] perl -e 1for$[=0 crash +{ +my $x

Re: [PATCH] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-18 Thread Abigail
On Thu, Jun 16, 2005 at 10:24:24PM -0500, Steve Peters wrote: I see this sort of behavior more when putting the code into a quoted eval. [EMAIL PROTECTED]:~/sandbox$ perl -le'eval 1 for $[=0; print $@' Can't modify constant item in scalar assignment at (eval 1) line 2, at EOF An

[PATCH replacement] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-18 Thread Rick Delaney
modify hash dereference in repeat \(x\)/, '[EMAIL PROTECTED]' ); @@ -168,3 +168,25 @@ eval q{ sub _ __FILE__ {} }; like($@, qr/Illegal declaration of subroutine main::_/, __FILE__ as prototype); } + +# [perl #36313] perl -e 1for$[=0 crash +{ +my $x; +$x = 1 for $[ = 0; +pass

[PATCH] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-17 Thread Rick Delaney
); } + +# [perl #36313] perl -e 1for$[=0 crash +{ +my $x; +$x = 1 for $[ = 0; +pass('optimized assignment to $[ used to segfault in scalar context'); +if (($[) = 0) { $x = 1 } +pass('optimized assignment to $[ used to segfault in list context'); +$x = ($[=2.4); +is($x, 2

[perl #36313] perl -e 1for$[=0 crash

2005-06-16 Thread Piotr Fusik
# New Ticket Created by Piotr Fusik # Please include the string: [perl #36313] # in the subject line of all future correspondence about this issue. # URL: https://rt.perl.org/rt3/Ticket/Display.html?id=36313 This is a bug report for perl from [EMAIL PROTECTED], generated with the help of

Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-16 Thread Michael G Schwern
On Thu, Jun 16, 2005 at 03:54:18PM -, Piotr Fusik wrote: perl -e 1for$[=0 causes a null pointer dereference. Confirmed in 5.8.1RC3, 5.8.6 and [EMAIL PROTECTED] on OS X 10.3 -- Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern Just call me 'Moron Sugar'.

[PATCH] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-16 Thread Steve Peters
On Thu, Jun 16, 2005 at 11:17:35AM -0700, Michael G Schwern wrote: On Thu, Jun 16, 2005 at 03:54:18PM -, Piotr Fusik wrote: perl -e 1for$[=0 causes a null pointer dereference. Confirmed in 5.8.1RC3, 5.8.6 and [EMAIL PROTECTED] on OS X 10.3 The attached patch prevents the coredump by

Re: [PATCH] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-16 Thread Rafael Garcia-Suarez
On 6/16/05, Steve Peters [EMAIL PROTECTED] wrote: --- op.c.oldMon Jun 13 11:52:00 2005 +++ op.cThu Jun 16 13:53:26 2005 @@ -3901,6 +3901,10 @@ I32 iterflags = 0; I32 iterpflags = 0; +if (!expr) { +DIE(aTHX_ \for\ missing a conditional expression); Surely

Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-16 Thread Abigail
On Thu, Jun 16, 2005 at 11:17:35AM -0700, Michael G Schwern wrote: On Thu, Jun 16, 2005 at 03:54:18PM -, Piotr Fusik wrote: perl -e 1for$[=0 causes a null pointer dereference. Confirmed in 5.8.1RC3, 5.8.6 and [EMAIL PROTECTED] on OS X 10.3 Quite old, actually: $

Re: [PATCH] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-16 Thread hv
Rafael Garcia-Suarez [EMAIL PROTECTED] wrote: :On 6/16/05, Steve Peters [EMAIL PROTECTED] wrote: [snip] :However you correctly found the cause of the problem. $[ is a :pragmatic variable and assignment to it happens at compile time and is :optimized away. So expr becomes NULL. : :Note that other

Re: [PATCH] Re: [perl #36313] perl -e 1for$[=0 crash

2005-06-16 Thread Steve Peters
On Fri, Jun 17, 2005 at 12:00:07AM +0100, [EMAIL PROTECTED] wrote: Rafael Garcia-Suarez [EMAIL PROTECTED] wrote: :On 6/16/05, Steve Peters [EMAIL PROTECTED] wrote: [snip] :However you correctly found the cause of the problem. $[ is a :pragmatic variable and assignment to it happens at compile