In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/42752acc4959c5b770bbc29532bf2677f4533c4e?hp=3bc0c78cf118c075b168ed58223722e9bc7ffd5a>

- Log -----------------------------------------------------------------
commit 42752acc4959c5b770bbc29532bf2677f4533c4e
Author: Karl Williamson <[email protected]>
Date:   Sat Jun 3 09:08:50 2017 -0600

    Make LOCK_LC_NUMERIC_STANDARD recursive
    
    Same for UNLOCK_LC_NUMERIC_STANDARD.
    
    This partially fixes [perl #128207]
-----------------------------------------------------------------------

Summary of changes:
 perl.h | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/perl.h b/perl.h
index de20aa249c..9022114121 100644
--- a/perl.h
+++ b/perl.h
@@ -6186,14 +6186,20 @@ expression, but with an empty argument list, like this:
         _restore_LC_NUMERIC_function = &Perl_set_numeric_standard;          \
     }
 
-/* Lock to the C locale until unlock is called */
+/* Lock/unlock to the C locale until unlock is called.  This needs to be
+ * recursively callable.  [perl #128207] */
 #define LOCK_LC_NUMERIC_STANDARD()                          \
         (__ASSERT_(PL_numeric_standard)                     \
-        PL_numeric_standard = 2)
-
+        PL_numeric_standard++)
 #define UNLOCK_LC_NUMERIC_STANDARD()                        \
-        (__ASSERT_(PL_numeric_standard == 2)                \
-        PL_numeric_standard = 1)
+            STMT_START {                                    \
+                if (PL_numeric_standard > 1) {              \
+                    PL_numeric_standard--;                  \
+                }                                           \
+                else {                                      \
+                    assert(0);                              \
+                }                                           \
+            } STMT_END
 
 #define RESTORE_LC_NUMERIC_UNDERLYING()                     \
        if (_was_local) set_numeric_local();

--
Perl5 Master Repository

Reply via email to