summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-07-02 01:49:11 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-07-02 01:49:11 +0000
commit8b7059b1a993d7ac934442e99623d9dbc5fe3ce8 (patch)
tree7103d4613a669489d661dc301f5e71e1f13f4129 /scope.c
parent6f980a54574e0bf71b1f27e663d5e95cbb8a2612 (diff)
downloadperl-8b7059b1a993d7ac934442e99623d9dbc5fe3ce8.tar.gz
[perl #30258] utf8 POPSTACK crash on split execution
split() does a SWITCHSTACK to directly split to an array, but if it subsequently dies (eg the regex triggers a 'use utf8' which is then denied by Safe), then the switch doesn't get undone. Add a new save type to allow for this. p4raw-id: //depot/perl@23023
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index 452ea774fe..54d4488344 100644
--- a/scope.c
+++ b/scope.c
@@ -1063,6 +1063,15 @@ Perl_leave_scope(pTHX_ I32 base)
AvARRAY((PAD*)ptr)[off] = (SV*)SSPOPPTR;
}
break;
+ case SAVEt_SAVESWITCHSTACK:
+ {
+ dSP;
+ AV* t = (AV*)SSPOPPTR;
+ AV* f = (AV*)SSPOPPTR;
+ SWITCHSTACK(t,f);
+ PL_curstackinfo->si_stack = f;
+ }
+ break;
case SAVEt_SET_SVFLAGS:
{
U32 val = (U32)SSPOPINT;