Skip to content

Commit d820a0f

Browse files
committed
regexec.c: Use Perl_croak_nocontext()
Instead of doing a dTHX introduced in 22b433e. I should have pointed out in that commit message, that instead of doing a full-fledged UTF-8 well-formedness check, it does a quick sanity check sufficient to prevent looping Spotted by Vincent Pitt
1 parent 387eee9 commit d820a0f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

regexec.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8762,8 +8762,7 @@ S_reghop3(U8 *s, SSize_t off, const U8* lim)
87628762
while (s > lim && UTF8_IS_CONTINUATION(*s))
87638763
s--;
87648764
if (! UTF8_IS_START(*s)) {
8765-
dTHX;
8766-
Perl_croak(aTHX_ "Malformed UTF-8 character (fatal)");
8765+
Perl_croak_nocontext("Malformed UTF-8 character (fatal)");
87678766
}
87688767
}
87698768
/* XXX could check well-formedness here */
@@ -8790,8 +8789,7 @@ S_reghop4(U8 *s, SSize_t off, const U8* llim, const U8* rlim)
87908789
while (s > llim && UTF8_IS_CONTINUATION(*s))
87918790
s--;
87928791
if (! UTF8_IS_START(*s)) {
8793-
dTHX;
8794-
Perl_croak(aTHX_ "Malformed UTF-8 character (fatal)");
8792+
Perl_croak_nocontext("Malformed UTF-8 character (fatal)");
87958793
}
87968794
}
87978795
/* XXX could check well-formedness here */
@@ -8823,8 +8821,7 @@ S_reghopmaybe3(U8* s, SSize_t off, const U8* lim)
88238821
while (s > lim && UTF8_IS_CONTINUATION(*s))
88248822
s--;
88258823
if (! UTF8_IS_START(*s)) {
8826-
dTHX;
8827-
Perl_croak(aTHX_ "Malformed UTF-8 character (fatal)");
8824+
Perl_croak_nocontext("Malformed UTF-8 character (fatal)");
88288825
}
88298826
}
88308827
/* XXX could check well-formedness here */

0 commit comments

Comments
 (0)