diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2007-10-10 15:03:16 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2007-10-10 15:03:16 +0000 |
commit | 401667e9af6ec282136e4e49614eb18614c5654b (patch) | |
tree | 3ebb10d18d00ed4a592ea9e627e043795c4cd72d /op.c | |
parent | 5108dc18037af131227ae095719eaab3a8fd54cb (diff) | |
download | perl-401667e9af6ec282136e4e49614eb18614c5654b.tar.gz |
newCONTSUB() wasn't thread-safe ([perl #45053])
p4raw-id: //depot/perl@32091
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -5696,6 +5696,13 @@ Perl_newCONSTSUB(pTHX_ HV *stash, const char *name, SV *sv) ENTER; + if (IN_PERL_RUNTIME) { + /* at runtime, it's not safe to manipulate PL_curcop: it may be + * an op shared between threads. Use a non-shared COP for our + * dirty work */ + SAVEVPTR(PL_curcop); + PL_curcop = &PL_compiling; + } SAVECOPLINE(PL_curcop); CopLINE_set(PL_curcop, PL_parser ? PL_parser->copline : NOLINE); |