diff options
author | Karl Williamson <khw@cpan.org> | 2020-12-24 20:25:00 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-09-29 13:08:27 -0600 |
commit | 6f1ad35dcc6509f071c8a5f4b763c4fa8d2757ab (patch) | |
tree | 729208ed689de9caaf71ac66c262b1c315c858cd /pp.c | |
parent | 6abc6edf8aa45e6c9145a5704e848b4675b5a010 (diff) | |
download | perl-6f1ad35dcc6509f071c8a5f4b763c4fa8d2757ab.tar.gz |
pp.c: Add mutex around a format
Stress testing showed this needed a mutex and copy in threaded perls.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -2903,10 +2903,16 @@ PP(pp_sin) #if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan) ! Perl_isnan(value) && #endif - (op_type == OP_LOG ? (value <= 0.0) : (value < 0.0))) { + (op_type == OP_LOG ? (value <= 0.0) : (value < 0.0))) + { + char * mesg; + SETLOCALE_LOCK; SET_NUMERIC_STANDARD(); + mesg = Perl_form(aTHX_ "Can't take %s of %" NVgf, neg_report, value); + SETLOCALE_UNLOCK; + /* diag_listed_as: Can't take log of %g */ - DIE(aTHX_ "Can't take %s of %" NVgf, neg_report, value); + DIE(aTHX_ "%s", mesg); } } switch (op_type) { |