From 1080621ae2d5ad29fefc44c5fe97ff7c18ad96ce Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 24 Dec 2020 20:25:00 -0700 Subject: [PATCH] XXX pp.c: do %g print under mutex, --- pp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pp.c b/pp.c index 68b4e461562d..bb97fc8c8aaa 100644 --- a/pp.c +++ b/pp.c @@ -2879,10 +2879,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) {