]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.3' into PHP-5.4
authorDmitry Stogov <dmitry@zend.com>
Thu, 6 Sep 2012 08:14:29 +0000 (12:14 +0400)
committerDmitry Stogov <dmitry@zend.com>
Thu, 6 Sep 2012 08:14:29 +0000 (12:14 +0400)
* PHP-5.3:
  - Fixed bug #61767 (Shutdown functions not called in certain error situation) - Fixed bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function)

Conflicts:
NEWS
Zend/zend_object_handlers.c

1  2 
NEWS
Zend/zend.c
Zend/zend_object_handlers.c

diff --cc NEWS
index 22d3f664e23a75c71dc175b6f4768da9798ab686,a1ff9b9ffa831fc0f64fde0e6381260a2526ceff..db6f7f48d27c83467a157045c4bc9147922449bb
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -1,58 -1,30 +1,62 @@@
  PHP                                                                        NEWS
  |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 -?? ??? 2012, PHP 5.3.16
 +?? ??? 2012, PHP 5.4.8
  
  - Core:
 +  . Added optional second argument for assert() to specify custom message. Patch
 +    by Lonny Kapelushnik (lonny@lonnylot.com). (Lars)
    . Fixed bug #62976 (Notice: could not be converted to int when comparing
      some builtin classes). (Laruence)
 -  . Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence)
    . Fixed bug #62955 (Only one directive is loaded from "Per Directory Values" 
      Windows registry). (aserbulov at parallels dot com)
 -  . Fixed bug #62763 (register_shutdown_function and extending class). 
 -    (Laruence)
 -  . Fixed bug #62744 (dangling pointers made by zend_disable_class). (Laruence)
 -  . Fixed bug #62716 (munmap() is called with the incorrect length). 
 -    (slangley@google.com)
 -  . Fixed bug #62460 (php binaries installed as binary.dSYM). (Reeze Xia)
 +  . Fixed bug #62907 (Double free when use traits). (Dmitry)
+   . Fixed bug #61767 (Shutdown functions not called in certain error
+     situation). (Dmitry)
 -  . Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK
 -    with run-test.php). (Laruence)
+   . Fixed bug #60909 (custom error handler throwing Exception + fatal error
+     = no shutdown function). (Dmitry)
  
 +- SOAP
 +  . Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
 +    (Dmitry)
 +
 +- SPL:
 +  . Bug #62987 (Assigning to ArrayObject[null][something] overrides all 
 +    undefined variables). (Laruence)
 +
 +- mbstring:
 +  . Allow passing null as a default value to mb_substr() and mb_strcut(). Patch
 +    by Alexander Moskaliov via GitHub PR #133. (Lars)
 +
 +- Filter extension:
 +  . Bug #49510: Boolean validation fails with FILTER_NULL_ON_FAILURE with empty
 +    string or false. (Lars)
 +
 +?? ??? 2012, PHP 5.4.7
 +
 +- Core:
 +  . Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence)
 +  . Fixed bug #62844 (parse_url() does not recognize //). (Andrew Faulds).
 +  . Fixed bug #62829 (stdint.h included on platform where HAVE_STDINT_H is not 
 +    set). (Felipe)
 +  . Fixed bug #62763 (register_shutdown_function and extending class).
 +    (Laruence)
 +  . Fixed bug #62725 (Calling exit() in a shutdown function does not return
 +    the exit value). (Laruence)
 +  . Fixed bug #62744 (dangling pointers made by zend_disable_class). (Laruence)
 +  . Fixed bug #62716 (munmap() is called with the incorrect length).
 +    (slangley@google.com)
 +  . Fixed bug #62358 (Segfault when using traits a lot). (Laruence)
 +  . Fixed bug #62328 (implementing __toString and a cast to string fails)
 +    (Laruence)
 +  . Fixed bug #51363 (Fatal error raised by var_export() not caught by error 
 +    handler). (Lonny Kapelushnik)
 +  . Fixed bug #40459 (Stat and Dir stream wrapper methods do not call 
 +    constructor). (Stas)
 +
  - CURL:
 +  . Fixed bug #62912 (CURLINFO_PRIMARY_* AND CURLINFO_LOCAL_* not exposed).
 +      (Pierrick)
    . Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick)
 -  . Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false).
 -    (r.hampartsumyan@gmail.com, Laruence)
  
  - DateTime:
    . Fixed bug #62852 (Unserialize invalid DateTime causes crash).
diff --cc Zend/zend.c
index 09338e7f83436f18a4d4dfc798e8bfb46574c4c7,bd53d55183484a869a60d08f65f26bcc37095a96..9ab879a2a407050d7077b94931fc909d470f729a
@@@ -1025,9 -994,32 +1025,32 @@@ ZEND_API void zend_error(int type, cons
        zend_stack object_stack;
        zend_stack declare_stack;
        zend_stack list_stack;
 -      zend_stack labels_stack;
 +      zend_stack context_stack;
        TSRMLS_FETCH();
  
+       /* Report about uncaught exception in case of fatal errors */
+       if (EG(exception)) {
+               switch (type) {
+                       case E_CORE_ERROR:
+                       case E_ERROR:
+                       case E_RECOVERABLE_ERROR:
+                       case E_PARSE:
+                       case E_COMPILE_ERROR:
+                       case E_USER_ERROR:
+                               if (zend_is_executing(TSRMLS_C)) {
+                                       error_lineno = zend_get_executed_lineno(TSRMLS_C);
+                               }
+                               zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
+                               EG(exception) = NULL;
+                               if (zend_is_executing(TSRMLS_C) && EG(opline_ptr)) {
+                                       active_opline->lineno = error_lineno;
+                               }
+                               break;
+                       default:
+                               break;
+               }
+       }
        /* Obtain relevant filename and lineno */
        switch (type) {
                case E_CORE_ERROR:
index 60095f7062b1c16edf8db02e12c03166ea2d9b2b,eae47d9c5a43e3ba99574c280cf19ac6e285b23a..d82493aeafad35f74f184a61495bbd206df1b755
@@@ -1490,10 -1272,11 +1490,11 @@@ ZEND_API int zend_std_cast_object_tostr
                                        if (retval) {
                                                zval_ptr_dtor(&retval);
                                        }
 -                                      zend_error(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name);
+                                       EG(exception) = NULL;
 +                                      zend_error_noreturn(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name);
                                        return FAILURE;
                                }
 -                              if (Z_TYPE_P(retval) == IS_STRING) {
 +                              if (EXPECTED(Z_TYPE_P(retval) == IS_STRING)) {
                                        INIT_PZVAL(writeobj);
                                        if (readobj == writeobj) {
                                                zval_dtor(readobj);