summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-12-24 20:25:00 -0700
committerKarl Williamson <khw@cpan.org>2022-09-29 13:08:27 -0600
commit6f1ad35dcc6509f071c8a5f4b763c4fa8d2757ab (patch)
tree729208ed689de9caaf71ac66c262b1c315c858cd /pp.c
parent6abc6edf8aa45e6c9145a5704e848b4675b5a010 (diff)
downloadperl-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.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index 444c9ddb55..2b0cc3dd3f 100644
--- a/pp.c
+++ b/pp.c
@@ -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) {