summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-02-24 22:34:06 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-02-24 22:34:06 +0000
commite1548254d1365ef0342d5b64bb1fd1d996c1f70f (patch)
treed5d389ad50c88418da2a8908a3068665540eafac /op.c
parent1a55ae8d1f46d27f1b3a1abdec128eebcc247c7f (diff)
downloadperl-e1548254d1365ef0342d5b64bb1fd1d996c1f70f.tar.gz
Fix a segfault during optree construction. (bug #27024)
p4raw-id: //depot/perl@22371
Diffstat (limited to 'op.c')
-rw-r--r--op.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/op.c b/op.c
index c5b2e83d77..4bd252c567 100644
--- a/op.c
+++ b/op.c
@@ -3577,6 +3577,10 @@ Perl_newLOOPOP(pTHX_ I32 flags, I32 debuggable, OP *expr, OP *block)
}
}
+ /* 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);