pollita         Tue Jul 13 20:14:44 2004 EDT

  Modified files:              
    /php-src/ext/bcmath php_bcmath.h bcmath.c 
    /php-src    NEWS 
  Log:
  Bugfix# 28829 bcmath values for 0, 1, and 2 initialized/freed at wrong time for 
threaded sapis.
  
http://cvs.php.net/diff.php/php-src/ext/bcmath/php_bcmath.h?r1=1.18&r2=1.19&ty=u
Index: php-src/ext/bcmath/php_bcmath.h
diff -u php-src/ext/bcmath/php_bcmath.h:1.18 php-src/ext/bcmath/php_bcmath.h:1.19
--- php-src/ext/bcmath/php_bcmath.h:1.18        Thu Jan  8 12:31:50 2004
+++ php-src/ext/bcmath/php_bcmath.h     Tue Jul 13 20:14:43 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_bcmath.h,v 1.18 2004/01/08 17:31:50 sniper Exp $ */
+/* $Id: php_bcmath.h,v 1.19 2004/07/14 00:14:43 pollita Exp $ */
 
 #ifndef PHP_BCMATH_H
 #define PHP_BCMATH_H
@@ -30,6 +30,8 @@
 
 PHP_MINIT_FUNCTION(bcmath);
 PHP_MSHUTDOWN_FUNCTION(bcmath);
+PHP_RINIT_FUNCTION(bcmath);
+PHP_RSHUTDOWN_FUNCTION(bcmath);
 PHP_MINFO_FUNCTION(bcmath);
 
 PHP_FUNCTION(bcadd);
http://cvs.php.net/diff.php/php-src/ext/bcmath/bcmath.c?r1=1.60&r2=1.61&ty=u
Index: php-src/ext/bcmath/bcmath.c
diff -u php-src/ext/bcmath/bcmath.c:1.60 php-src/ext/bcmath/bcmath.c:1.61
--- php-src/ext/bcmath/bcmath.c:1.60    Wed May 12 06:15:45 2004
+++ php-src/ext/bcmath/bcmath.c Tue Jul 13 20:14:43 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: bcmath.c,v 1.60 2004/05/12 10:15:45 helly Exp $ */
+/* $Id: bcmath.c,v 1.61 2004/07/14 00:14:43 pollita Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -53,8 +53,8 @@
        bcmath_functions,
        PHP_MINIT(bcmath),
        PHP_MSHUTDOWN(bcmath),
-       NULL,
-       NULL,
+       PHP_RINIT(bcmath),
+       PHP_RSHUTDOWN(bcmath),
        PHP_MINFO(bcmath),
        NO_VERSION_YET,
        STANDARD_MODULE_PROPERTIES
@@ -86,8 +86,6 @@
 
        REGISTER_INI_ENTRIES();
 
-       bc_init_numbers(TSRMLS_C);
-
        return SUCCESS;
 }
 /* }}} */
@@ -96,15 +94,33 @@
  */
 PHP_MSHUTDOWN_FUNCTION(bcmath)
 {
+       UNREGISTER_INI_ENTRIES();
+
+       return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_RINIT_FUNCTION
+ */
+PHP_RINIT_FUNCTION(bcmath)
+{
+       bc_init_numbers(TSRMLS_C);
+
+       return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_RSHUTDOWN_FUNCTION
+ */
+PHP_RSHUTDOWN_FUNCTION(bcmath)
+{
        _bc_free_num_ex(&BCG(_zero_), 1);
        _bc_free_num_ex(&BCG(_one_), 1);
        _bc_free_num_ex(&BCG(_two_), 1);
 
-       UNREGISTER_INI_ENTRIES();
-
        return SUCCESS;
 }
-/* }}} */
+/* }}} */      
          
 /* {{{ PHP_MINFO_FUNCTION
  */
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1759&r2=1.1760&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1759 php-src/NEWS:1.1760
--- php-src/NEWS:1.1759 Tue Jul 13 15:56:48 2004
+++ php-src/NEWS        Tue Jul 13 20:14:43 2004
@@ -1,6 +1,7 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2004, PHP 5.0.1
+- Fixed bug #28829 (Thread-unsafety in bcmath elementary values). (Sara)
 
 13 Jul 2004, PHP 5.0.0
 - Updated PCRE to provide better error handling in certain cases. (Andrei)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to