From: Gurusamy Sarathy Date: Wed, 22 Mar 2000 15:38:49 +0000 (+0000) Subject: save RE context when calling __WARN__ and __DIE__ hooks; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3a1f2dc96a3b866c46ab6f878057fc73d4b009d4;p=p5sagit%2Fp5-mst-13.2.git save RE context when calling __WARN__ and __DIE__ hooks; add missing stack-of-stacks logic for new code that came in with lexical warnings (this fixes coredumps from -Mdiagnostics when the warnings happens to come from within the RE engine) p4raw-id: //depot/perl@5877 --- diff --git a/util.c b/util.c index bda2beb..059d9a4 100644 --- a/util.c +++ b/util.c @@ -1515,6 +1515,7 @@ Perl_vdie(pTHX_ const char* pat, va_list *args) SV *msg; ENTER; + save_re_context(); if (message) { msg = newSVpvn(message, msglen); SvREADONLY_on(msg); @@ -1604,6 +1605,7 @@ Perl_vcroak(pTHX_ const char* pat, va_list *args) SV *msg; ENTER; + save_re_context(); msg = newSVpvn(message, msglen); SvREADONLY_on(msg); SAVEFREESV(msg); @@ -1697,6 +1699,7 @@ Perl_vwarn(pTHX_ const char* pat, va_list *args) SV *msg; ENTER; + save_re_context(); msg = newSVpvn(message, msglen); SvREADONLY_on(msg); SAVEFREESV(msg); @@ -1810,15 +1813,17 @@ Perl_vwarner(pTHX_ U32 err, const char* pat, va_list* args) SV *msg; ENTER; + save_re_context(); msg = newSVpvn(message, msglen); SvREADONLY_on(msg); SAVEFREESV(msg); + PUSHSTACKi(PERLSI_DIEHOOK); PUSHMARK(sp); XPUSHs(msg); PUTBACK; call_sv((SV*)cv, G_DISCARD); - + POPSTACK; LEAVE; } } @@ -1843,21 +1848,23 @@ Perl_vwarner(pTHX_ U32 err, const char* pat, va_list* args) SAVESPTR(PL_warnhook); PL_warnhook = Nullsv; cv = sv_2cv(oldwarnhook, &stash, &gv, 0); - LEAVE; + LEAVE; if (cv && !CvDEPTH(cv) && (CvROOT(cv) || CvXSUB(cv))) { dSP; SV *msg; ENTER; + save_re_context(); msg = newSVpvn(message, msglen); SvREADONLY_on(msg); SAVEFREESV(msg); + PUSHSTACKi(PERLSI_WARNHOOK); PUSHMARK(sp); XPUSHs(msg); PUTBACK; call_sv((SV*)cv, G_DISCARD); - + POPSTACK; LEAVE; return; }