p4raw-id: //depot/perl@22371
}
}
+ /* if block is null, the next append_elem() would put UNSTACK, a scalar
+ * op, in listop. This is wrong. [perl #27024] */
+ if (!block)
+ block = newOP(OP_NULL, 0);
listop = append_elem(OP_LINESEQ, block, newOP(OP_UNSTACK, 0));
o = new_logop(OP_AND, 0, &expr, &listop);
}
require "./test.pl";
-plan( tests => 43 );
+plan( tests => 44 );
eval '%@x=0;';
like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' );
eval q{ sub f { @a=@b=@c; {use} } };
like( $@, qr/syntax error/, "use without body" );
}
+
+# Bug #27024
+{
+ # this used to segfault (because $[=1 is optimized away to a null block)
+ my $x;
+ $[ = 1 while $x;
+ pass();
+}