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;
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
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
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
+ $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).
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
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
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
);
}
+
+# [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
# 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
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'.
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
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
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:
$
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
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
16 matches
Mail list logo