summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
Diffstat (limited to 'op.c')
-rw-r--r--op.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/op.c b/op.c
index 8523739337..0d4e1e6ad6 100644
--- a/op.c
+++ b/op.c
@@ -8457,8 +8457,9 @@ Perl_ck_split(pTHX_ OP *o)
Perl_croak(aTHX_ "panic: ck_split");
kid = kid->op_sibling;
op_free(cLISTOPo->op_first);
- cLISTOPo->op_first = kid;
- if (!kid) {
+ if (kid)
+ cLISTOPo->op_first = kid;
+ else {
cLISTOPo->op_first = kid = newSVOP(OP_CONST, 0, newSVpvs(" "));
cLISTOPo->op_last = kid; /* There was only one element previously */
}