summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1997-02-18 13:22:00 +1200
committerChip Salzenberg <chip@atlantic.net>1997-02-18 13:22:00 +1200
commitff0cee690d2ef6ba882e59dd4baaa0c944adb7a2 (patch)
tree91b3d734c5c24df3e5127c9974064d91ec428678 /mg.c
parentf65adc383296c14b415f0ade0cf7fc4a27049a24 (diff)
downloadperl-ff0cee690d2ef6ba882e59dd4baaa0c944adb7a2.tar.gz
[inseparable changes from patch from perl5.003_26 to perl5.003_27]
BUILD PROCESS Subject: Fix eval "" in Configure Date: Fri, 14 Feb 1997 13:09:53 -0500 From: John L. Allen <allen@gateway.grumman.com> Files: Configure Subject: Re: Configure problem on IRIX - me dumb p5p-msgid: <9702141809.AA17001@gateway.grumman.com> Subject: Don't link with -lsfio if sfio is not requested From: Chip Salzenberg <chip@perl.com> Files: Configure Subject: perl5.003_26 Configure change "win" for AIX 4 Date: Fri, 14 Feb 1997 13:59:02 -0600 (CST) From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu> Files: Configure p5p-msgid: <Pine.OSF.3.95.970214135751.32654A-100000@dogbert.cc.ndsu.NoDak.edu> private-msgid: <Pine.OSF.3.95.970214135751.32654A-100000@dogbert.cc.ndsu.NoD CORE LANGUAGE CHANGES Subject: Better looks_like_number() function [sv.c] Date: Fri, 14 Feb 1997 18:08:52 +0100 From: Gisle Aas <aas@bergen.sn.no> Files: sv.c Msg-ID: <199702141708.SAA17546@bergen.sn.no> (applied based on p5p patch as commit 8dbaa58ee2aba7cc22d84199a674c58bbf108b46) Subject: Remove redundant functions UNIVERSAL::{class,is_instance} Date: 14 Feb 1997 15:52:21 +0000 From: Gisle Aas <aas@bergen.sn.no> Files: pod/perldelta.pod pod/perlobj.pod t/op/universal.t universal.c Msg-ID: <hwwsbpeq2.fsf@bergen.sn.no> (applied based on p5p patch as commit 77bb9b23081b62119e8fbe9f5655b8802e4537ae) Subject: Allow C<setpgrp $$> Date: 16 Feb 1997 23:19:12 -0500 From: Roderick Schertler <roderick@gate.net> Files: pp_sys.c Msg-ID: <pzraigyshr.fsf@eeyore.ibcinc.com> (applied based on p5p patch as commit 3d2573a84a1aa655d5da58c57b3fc20e04d40f9f) Subject: Fix syntax error on C<&$1> From: Chip Salzenberg <chip@perl.com> Files: toke.c Subject: Fix grep() with refs in array context From: Chip Salzenberg <chip@perl.com> Files: pp.c CORE PORTABILITY Subject: Eliminate $^S; add C<use vmsish qw(status exit time)> Date: Mon, 17 Feb 1997 02:45:26 -0500 (EST) From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU> Files: MANIFEST gv.c lib/English.pm lib/ExtUtils/MM_VMS.pm lib/ExtUtils/Mksymlists.pm lib/ExtUtils/xsubpp mg.c op.c perl.c perl.h pod/perldelta.pod pod/perlmod.pod pod/perlvar.pod pp_ctl.c pp_sys.c utils/perldoc.PL vms/Makefile vms/config.vms vms/descrip.mms vms/ext/Stdio/Stdio.pm vms/ext/Stdio/Stdio.xs vms/ext/XSSymSet.pm vms/ext/vmsish.pm vms/vms.c vms/vmsish.h win32/makedef.pl private-msgid: <01IFI9CFKL0S004R2V@hmivax.humgen.upenn.edu> LIBRARY AND EXTENSIONS Subject: Remove Fatal.pm From: Chip Salzenberg <chip@perl.com> Files: MANIFEST lib/Fatal.pm pod/perldelta.pod pod/perlmod.pod pod/roffitall t/lib/fatal.t Subject: Refresh MakeMaker to 5.40 From: Andy Dougherty <doughera@lafcol.lafayette.edu> Files: lib/ExtUtils/Liblist.pm lib/ExtUtils/MM_Unix.pm lib/ExtUtils/MakeMaker.pm lib/ExtUtils/Mksymlists.pm OTHER CORE CHANGES Subject: Fix core dump when embedding From: Chip Salzenberg <chip@perl.com> Files: perl.c Subject: Re: Fragile signals Date: Thu, 13 Feb 1997 01:44:39 -0500 (EST) From: Ilya Zakharevich <ilya@math.ohio-state.edu> Files: mg.c Msg-ID: <199702130644.BAA07572@monk.mps.ohio-state.edu> (applied based on p5p patch as commit 09df8c7df7dfc9853902f1fdd8a6d95f53be66fc) Subject: Make format strings correspond exactly to parameters Date: 13 Feb 1997 17:24:31 -0500 From: Roderick Schertler <roderick@gate.net> Files: doio.c ext/DB_File/DB_File.xs ext/Opcode/Opcode.xs gv.c op.c perl.c pp_ctl.c pp_sys.c regcomp.c toke.c Msg-ID: <pz7mkc1h0g.fsf@eeyore.ibcinc.com> (applied based on p5p patch as commit bf81aadd817bdea29720b072eef945df2da8463b) Subject: Don't try to attach 'o' magic to read-only values From: Chip Salzenberg <chip@perl.com> Files: sv.c Subject: Fix carriage-return message From: Chip Salzenberg <chip@perl.com> Files: toke.c Subject: In <=>, test for equality first From: Chip Salzenberg <chip@perl.com> Files: pp.c Subject: Don't mark sv_{true,false} PADTMP From: Chip Salzenberg <chip@perl.com> Files: op.c
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c68
1 files changed, 45 insertions, 23 deletions
diff --git a/mg.c b/mg.c
index 77c0417818..f42a4ad339 100644
--- a/mg.c
+++ b/mg.c
@@ -386,12 +386,6 @@ MAGIC *mg;
case '\020': /* ^P */
sv_setiv(sv, (IV)perldb);
break;
- case '\023': /* ^S */
- if (STATUS_NATIVE == -1)
- sv_setiv(sv, (IV)-1);
- else
- sv_setuv(sv, (UV)STATUS_NATIVE);
- break;
case '\024': /* ^T */
#ifdef BIG_TIME
sv_setnv(sv, basetime);
@@ -462,7 +456,11 @@ MAGIC *mg;
#endif
break;
case '?':
- sv_setiv(sv, (IV)STATUS_POSIX);
+ sv_setiv(sv, (IV)STATUS_CURRENT);
+#ifdef COMPLEX_STATUS
+ LvTARGOFF(sv) = statusvalue;
+ LvTARGLEN(sv) = statusvalue_vms;
+#endif
break;
case '^':
s = IoTOP_NAME(GvIOp(defoutgv));
@@ -708,13 +706,11 @@ MAGIC* mg;
warn("No such signal: SIG%s", s);
return 0;
}
- if(psig_ptr[i])
- SvREFCNT_dec(psig_ptr[i]);
+ SvREFCNT_dec(psig_name[i]);
+ SvREFCNT_dec(psig_ptr[i]);
psig_ptr[i] = SvREFCNT_inc(sv);
- if(psig_name[i])
- SvREFCNT_dec(psig_name[i]);
- psig_name[i] = newSVpv(s,strlen(s));
SvTEMP_off(sv); /* Make sure it doesn't go away on us */
+ psig_name[i] = newSVpv(s, strlen(s));
SvREADONLY_on(psig_name[i]);
}
if (SvTYPE(sv) == SVt_PVGV || SvROK(sv)) {
@@ -1269,9 +1265,6 @@ MAGIC* mg;
}
perldb = i;
break;
- case '\023': /* ^S */
- STATUS_NATIVE_SET(SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv));
- break;
case '\024': /* ^T */
#ifdef BIG_TIME
basetime = (Time_t)(SvNOK(sv) ? SvNVX(sv) : sv_2nv(sv));
@@ -1351,7 +1344,19 @@ MAGIC* mg;
compiling.cop_arybase = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
break;
case '?':
- STATUS_POSIX_SET(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
+#ifdef COMPLEX_STATUS
+ if (localizing == 2) {
+ statusvalue = LvTARGOFF(sv);
+ statusvalue_vms = LvTARGLEN(sv);
+ }
+ else
+#endif
+#ifdef VMSISH_STATUS
+ if (VMSISH_STATUS)
+ STATUS_NATIVE_SET((U32)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv)));
+ else
+#endif
+ STATUS_POSIX_SET(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
break;
case '!':
SETERRNO(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv),
@@ -1540,10 +1545,23 @@ int sig;
SV *sv;
CV *cv;
AV *oldstack;
-
- if(!psig_ptr[sig])
- die("Signal SIG%s received, but no signal handler set.\n",
- sig_name[sig]);
+ bool long_savestack = (savestack_ix + 14) < savestack_max;
+ bool long_cxstack = (cxstack_ix + 1) < cxstack_max;
+
+ /* Protect PUSHXXX in progress. */
+ if (long_cxstack)
+ cxstack_ix++;
+
+ if (!psig_ptr[sig])
+ die("Signal SIG%s received, but no signal handler set.\n",
+ sig_name[sig]);
+
+ /*
+ * Protect save in progress. Max number of items pushed there is
+ * 3*n or 4. We cannot fix infinity, so we fix 4 (in fact 5).
+ */
+ if (long_savestack)
+ savestack_ix += 5;
cv = sv_2cv(psig_ptr[sig],&st,&gv,TRUE);
if (!cv || !CvROOT(cv)) {
@@ -1561,8 +1579,8 @@ int sig;
if(psig_name[sig])
sv = SvREFCNT_inc(psig_name[sig]);
else {
- sv = sv_newmortal();
- sv_setpv(sv,sig_name[sig]);
+ sv = sv_newmortal();
+ sv_setpv(sv,sig_name[sig]);
}
PUSHMARK(sp);
PUSHs(sv);
@@ -1571,6 +1589,10 @@ int sig;
perl_call_sv((SV*)cv, G_DISCARD);
SWITCHSTACK(signalstack, oldstack);
-
+ if (long_savestack)
+ savestack_ix -= 5; /* Unprotect save in progress. */
+ if (long_cxstack)
+ cxstack_ix--; /* Unprotect PUSHXXX in progress. */
+
return;
}