summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorSADAHIRO Tomoyuki <BQW10602@nifty.com>2005-11-05 05:54:00 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-11-05 10:10:09 +0000
commitb59aed6733cbdee6d898449f638bd7a17e772993 (patch)
tree3d79c82df1f02445212eb9d4c3b748081c667794 /pp_sys.c
parent2bd49cfcbebe5157c802aba335cb6f76b1afa6fd (diff)
downloadperl-b59aed6733cbdee6d898449f638bd7a17e772993.tar.gz
Re: A surprising segfault
Message-Id: <20051105135053.27D7.BQW10602@nifty.com> p4raw-id: //depot/perl@26011
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/pp_sys.c b/pp_sys.c
index c6eb020312..5c1ebd2b1c 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -430,12 +430,16 @@ PP(pp_warn)
SV *tmpsv;
const char *tmps;
STRLEN len;
- if (SP - MARK != 1) {
+ if (SP - MARK > 1) {
dTARGET;
do_join(TARG, &PL_sv_no, MARK, SP);
tmpsv = TARG;
SP = MARK + 1;
}
+ else if (SP == MARK) {
+ tmpsv = &PL_sv_no;
+ EXTEND(SP, 1);
+ }
else {
tmpsv = TOPs;
}
@@ -3402,7 +3406,7 @@ PP(pp_chown)
const I32 value = (I32)apply(PL_op->op_type, MARK, SP);
SP = MARK;
- PUSHi(value);
+ XPUSHi(value);
RETURN;
}
@@ -3993,7 +3997,7 @@ PP(pp_system)
if (errno != EAGAIN) {
value = -1;
SP = ORIGMARK;
- PUSHi(value);
+ XPUSHi(value);
if (did_pipes) {
PerlLIO_close(pp[0]);
PerlLIO_close(pp[1]);
@@ -4042,7 +4046,7 @@ PP(pp_system)
STATUS_NATIVE_CHILD_SET(-1);
}
}
- PUSHi(STATUS_CURRENT);
+ XPUSHi(STATUS_CURRENT);
RETURN;
}
if (did_pipes) {
@@ -4088,7 +4092,7 @@ PP(pp_system)
STATUS_NATIVE_CHILD_SET(value);
do_execfree();
SP = ORIGMARK;
- PUSHi(result ? value : STATUS_CURRENT);
+ XPUSHi(result ? value : STATUS_CURRENT);
#endif /* !FORK or VMS */
RETURN;
}
@@ -4140,7 +4144,7 @@ PP(pp_exec)
}
SP = ORIGMARK;
- PUSHi(value);
+ XPUSHi(value);
RETURN;
}