summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-10-01 06:30:35 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-01 06:33:49 -0700
commitba6ff154b0d807025f5294b2c3e9623fd60a6e97 (patch)
tree93f8ddbbe96480fc1a61caaa2b9599d59319d7a6 /utf8.c
parentd78f9ffa7317e24a5eaf54a2cf107e6663784159 (diff)
downloadperl-ba6ff154b0d807025f5294b2c3e9623fd60a6e97.tar.gz
[perl #99984] Incorrect errmsg with our $::é
Having PL_parser->error_count set to non-zero when utf8_heavy.pl tries to do() one of its swashes results in ‘Compilation error’ being placed in $@ during the do, even if it was successful. This patch sets the error_count to 0 before calling SWASHNEW, to prevent that. It uses SAVEI8, to make sure it is restored on scope exit.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/utf8.c b/utf8.c
index 4bab3a9b84..003e3fcadd 100644
--- a/utf8.c
+++ b/utf8.c
@@ -2050,6 +2050,8 @@ Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits
ENTER;
SAVEHINTS();
save_re_context();
+ if (PL_parser && PL_parser->error_count)
+ SAVEI8(PL_parser->error_count), PL_parser->error_count = 0;
method = gv_fetchmeth(stash, "SWASHNEW", 8, -1);
if (!method) { /* demand load utf8 */
ENTER;