summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1997-02-04 17:47:00 +1200
committerChip Salzenberg <chip@atlantic.net>1997-02-04 17:47:00 +1200
commitf86702ccfcc3646d7aa30b09ce4f4413be9f99d1 (patch)
treef8a3d6634bf3149e753dd0ea414c0c0079003708 /pp_hot.c
parent8a7dc658e6602067382c308b2131d135e4063624 (diff)
downloadperl-f86702ccfcc3646d7aa30b09ce4f4413be9f99d1.tar.gz
[inseparable changes from patch from perl5.003_24 to perl5.003_25]perl-5.003_25
CORE LANGUAGE CHANGES Subject: Make $] read-only From: Chip Salzenberg <chip@perl.com> Files: gv.c Subject: New variable C<$^S> is a native version of C<$?> From: Chip Salzenberg <chip@perl.com> Files: doio.c global.sym gv.c interp.sym lib/English.pm mg.c perl.c perl.h pod/perldelta.pod pod/perlfunc.pod pod/perlvar.pod pp_ctl.c pp_sys.c proto.h util.c Subject: Make $^T work with undump, and don't taint it From: Chip Salzenberg <chip@perl.com> Files: perl.c CORE PORTABILITY Subject: VMS patches for _24 Date: Fri, 31 Jan 1997 02:34:37 -0500 (EST) From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU> Files: ext/DynaLoader/DynaLoader.pm ext/DynaLoader/dl_vms.xs lib/AutoSplit.pm lib/ExtUtils/MM_VMS.pm lib/ExtUtils/MakeMaker.pm perl.h pp_hot.c t/lib/filehand.t t/op/closure.t vms/Makefile vms/config.vms vms/descrip.mms vms/ext/filespec.t vms/vms.c vms/vmsish.h private-msgid: <01IEUIFP5038004GQP@hmivax.humgen.upenn.edu> DOCUMENTATION Subject: Document how extension pms go in $archlib From: Chip Salzenberg <chip@perl.com> Files: pod/perldelta.pod Subject: perlfunc.pod tweaks Date: Thu, 30 Jan 1997 16:20:55 -0500 From: Roderick Schertler <roderick@gate.net> Files: pod/perlfunc.pod private-msgid: <20526.854659255@eeyore.ibcinc.com> Subject: Error lines must not have trailing periods From: Chip Salzenberg <chip@perl.com> Files: pod/perldiag.pod LIBRARY AND EXTENSIONS Subject: Make IO::Handle::gets() an alias of getline Date: Thu, 30 Jan 1997 12:03:15 +0100 From: Gisle Aas <aas@bergen.sn.no> Files: ext/IO/lib/IO/Handle.pm lib/IO/Handle.pm private-msgid: <199701301103.MAA11291@bergen.sn.no> OTHER CORE CHANGES Subject: Require '-T' in argv[], not just on #! line From: Chip Salzenberg <chip@perl.com> Files: perl.c pod/perldiag.pod Subject: Fix C<return @_> and associated stack bugs From: Chip Salzenberg <chip@perl.com> Files: cop.h pp_ctl.c pp_hot.c t/op/misc.t Subject: Fix never-closing handle after C<select> From: Chip Salzenberg <chip@perl.com> Files: pp_sys.c Subject: Fix /\G/g with patterns that match empty string From: Ilya Zakharevich <ilya@math.ohio-state.edu> Files: pp_hot.c Subject: Don't create AV, HV, IO when assigning glob From: Chip Salzenberg <chip@perl.com> Files: mg.c TESTS Subject: More Amiga test patches Date: Wed, 29 Jan 1997 16:07:33 +0100 From: "Norbert Pueschel" <pueschel@imsdd.meb.uni-bonn.de> Files: README.amiga t/lib/safe2.t t/op/closure.t private-msgid: <77724725@Armageddon.meb.uni-bonn.de>
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 120c026b4b..16c250593e 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -769,6 +769,7 @@ PP(pp_match)
STRLEN len;
I32 minmatch = 0;
I32 oldsave = savestack_ix;
+ I32 update_minmatch = 1;
if (op->op_flags & OPf_STACKED)
TARG = POPs;
@@ -799,6 +800,7 @@ PP(pp_match)
if (mg && mg->mg_len >= 0) {
rx->endp[0] = rx->startp[0] = s + mg->mg_len;
minmatch = (mg->mg_flags & MGf_MINMATCH);
+ update_minmatch = 0;
}
}
}
@@ -815,7 +817,8 @@ play_it_again:
t = s = rx->endp[0];
if (s >= strend)
goto nope;
- minmatch = (s == rx->startp[0]);
+ if (update_minmatch++)
+ minmatch = (s == rx->startp[0]);
}
if (pm->op_pmshort) {
if (pm->op_pmflags & PMf_SCANFIRST) {
@@ -1052,7 +1055,7 @@ do_readline()
*(end++) = '\n'; *end = '\0';
for (cp = rstr; *cp; cp++) *cp = _tolower(*cp);
if (hasdir) {
- if (isunix) trim_unixpath(rstr,SvPVX(tmpglob));
+ if (isunix) trim_unixpath(rstr,SvPVX(tmpglob),1);
begin = rstr;
}
else {
@@ -1654,37 +1657,33 @@ PP(pp_leavesub)
PMOP *newpm;
I32 gimme;
register CONTEXT *cx;
+ struct block_sub cxsub;
POPBLOCK(cx,newpm);
- /* Delay POPSUB until stack values are safe */
-
+ POPSUB1(cx); /* Delay POPSUB2 until stack values are safe */
+
if (gimme == G_SCALAR) {
MARK = newsp + 1;
if (MARK <= SP)
- if (SvFLAGS(TOPs) & SVs_TEMP)
- *MARK = TOPs;
- else
- *MARK = sv_mortalcopy(TOPs);
+ *MARK = SvTEMP(TOPs) ? TOPs : sv_mortalcopy(TOPs);
else {
- MEXTEND(mark,0);
+ MEXTEND(MARK, 0);
*MARK = &sv_undef;
}
SP = MARK;
}
else {
- for (mark = newsp + 1; mark <= SP; mark++)
- if (!(SvFLAGS(*mark) & SVs_TEMP))
- *mark = sv_mortalcopy(*mark);
- /* in case LEAVE wipes old return values */
+ for (MARK = newsp + 1; MARK <= SP; MARK++) {
+ if (!SvTEMP(*MARK))
+ *MARK = sv_mortalcopy(*MARK);
+ }
}
-
- /* Now that stack values are safe, release CV and @_ */
- POPSUB(cx);
-
- curpm = newpm; /* Don't pop $1 et al till now */
+ PUTBACK;
+
+ POPSUB2(); /* Stack values are safe: release CV and @_ ... */
+ curpm = newpm; /* ... and pop $1 et al */
LEAVE;
- PUTBACK;
return pop_return();
}