summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2002-11-03 16:41:24 +0000
committerhv <hv@crypt.org>2002-11-07 11:33:38 +0000
commite9f19e3c03f1d62dc32ee20c3f9cd088c9618f14 (patch)
tree074318b65e31ea0e26364ff00d9c2dcd871934a9 /op.c
parent3d40713cb3f43f5a6bd87317708c170c5a6a2304 (diff)
downloadperl-e9f19e3c03f1d62dc32ee20c3f9cd088c9618f14.tar.gz
Re: [perl #17605] strange behaviour (difference between perl 5.6 and perl 5.8.0) in the regexp
Message-Id: <200211031641.gA3GfOm08609@crypt.compulink.co.uk> p4raw-id: //depot/perl@18118
Diffstat (limited to 'op.c')
-rw-r--r--op.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/op.c b/op.c
index 8c947b7f4c..9f9722722f 100644
--- a/op.c
+++ b/op.c
@@ -1756,9 +1756,14 @@ Perl_block_end(pTHX_ I32 floor, OP *seq)
{
int needblockscope = PL_hints & HINT_BLOCK_SCOPE;
line_t copline = PL_copline;
- /* there should be a nextstate in every block */
- OP* retval = seq ? scalarseq(seq) : newSTATEOP(0, Nullch, seq);
- PL_copline = copline; /* XXX newSTATEOP may reset PL_copline */
+ OP* retval = scalarseq(seq);
+ if (!seq) {
+ /* scalarseq() gave us an OP_STUB */
+ retval->op_flags |= OPf_PARENS;
+ /* there should be a nextstate in every block */
+ retval = newSTATEOP(0, Nullch, retval);
+ PL_copline = copline; /* XXX newSTATEOP may reset PL_copline */
+ }
LEAVE_SCOPE(floor);
PL_compiling.op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
if (needblockscope)