diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2005-03-26 21:25:47 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2005-03-26 21:25:47 +0000 |
commit | 96ca9f552a246a04e9873c974fac21138f3acd66 (patch) | |
tree | 975ad0f38ecbdf0b5531b249845c4602bb560fd7 /utf8.c | |
parent | 1ef29b0ef2de54bf3c997c80d0645374658d5ef2 (diff) | |
download | perl-96ca9f552a246a04e9873c974fac21138f3acd66.tar.gz |
[perl #33185] UTF-8 string substitution corrupts memory
The implicit call of 'require utf8' triggered by code like
"\x{100}" =~ /[[:print:]]/
wasn't saving state correctly first.
p4raw-id: //depot/perl@24084
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1578,6 +1578,11 @@ Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits HV *stash = gv_stashpvn(pkg, pkg_len, FALSE); SV* errsv_save; + PUSHSTACKi(PERLSI_MAGIC); + ENTER; + SAVEI32(PL_hints); + PL_hints = 0; + save_re_context(); if (!gv_fetchmeth(stash, "SWASHNEW", 8, -1)) { /* demand load utf8 */ ENTER; errsv_save = newSVsv(ERRSV); @@ -1589,7 +1594,6 @@ Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits LEAVE; } SPAGAIN; - PUSHSTACKi(PERLSI_MAGIC); PUSHMARK(SP); EXTEND(SP,5); PUSHs(sv_2mortal(newSVpvn(pkg, pkg_len))); @@ -1598,10 +1602,6 @@ Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits PUSHs(sv_2mortal(newSViv(minbits))); PUSHs(sv_2mortal(newSViv(none))); PUTBACK; - ENTER; - SAVEI32(PL_hints); - PL_hints = 0; - save_re_context(); if (IN_PERL_COMPILETIME) { /* XXX ought to be handled by lex_start */ SAVEI32(PL_in_my); |