Commit:    290509755ac4a3279b2b31b899aa9f2dd780f5f4
Author:    Xinchen Hui <larue...@php.net>         Thu, 7 Feb 2013 23:44:46 +0800
Parents:   0547a36e95ec36025a30e93e971d26b6b1ecf0e9
Branches:  PHP-5.5

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=290509755ac4a3279b2b31b899aa9f2dd780f5f4

Log:
Fixed bug #64135 (Exceptions from set_error_handler are not always propagated)

Bugs:
https://bugs.php.net/64135

Changed paths:
  M  NEWS
  M  Zend/tests/bug61767.phpt
  M  Zend/zend_vm_def.h
  M  Zend/zend_vm_execute.h


Diff:
diff --git a/NEWS b/NEWS
index c343f43..3bb6ace 100644
--- a/NEWS
+++ b/NEWS
@@ -3,11 +3,13 @@ PHP                                                           
             NEWS
 ?? ??? 201?, PHP 5.5.0 Beta 1
 
 - Core:
+  . Fixed bug #64135 (Exceptions from set_error_handler are not always
+    propagated). (Laruence)
+  . Fixed bug #63830 (Segfault on undefined function call in nested generator).
+    (Nikita Popov)
   . Fixed bug #60833 (self, parent, static behave inconsistently 
     case-sensitive). (Stas, mario at include-once dot org)
   . Implemented FR #60524 (specify temp dir by php.ini). (ALeX Kazik).
-  . Fixed bug #63830 (Segfault on undefined function call in nested generator).
-    (Nikita Popov)
 
 - CLI server:
   . Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi)
diff --git a/Zend/tests/bug61767.phpt b/Zend/tests/bug61767.phpt
index 5270872..9bd9c90 100644
--- a/Zend/tests/bug61767.phpt
+++ b/Zend/tests/bug61767.phpt
@@ -17,18 +17,16 @@ $undefined->foo();
 --EXPECTF--
 Error handler called (Undefined variable: undefined)
 
-Warning: Uncaught exception 'ErrorException' with message 'Undefined variable: 
undefined' in %sbug61767.php:13
+Fatal error: Uncaught exception 'ErrorException' with message 'Undefined 
variable: undefined' in %sbug61767.php:%d
 Stack trace:
-#0 %sbug61767.php(13): {closure}(8, 'Undefined varia...', '%s', 13, Array)
+#0 %sbug61767.php(%d): {closure}(%s, 'Undefined varia...', '%s', %d, Array)
 #1 {main}
-  thrown in %sbug61767.php on line 13
-
-Fatal error: Call to a member function foo() on a non-object in %sbug61767.php 
on line 13
+  thrown in %sbug61767.php on line %d
 Shutting down
 Array
 (
     [type] => 1
-    [message] => Call to a member function foo() on a non-object
+    [message] => %a
     [file] => %sbug61767.php
-    [line] => 13
+    [line] => %d
 )
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 4dd544e..cbd3810 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2462,6 +2462,10 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, 
TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+                       FREE_OP2();
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 25ac1ea..7b874de 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -8947,6 +8947,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -9801,6 +9805,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+                       zval_dtor(free_op2.var);
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -10660,6 +10668,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+                       if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -12094,6 +12106,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -15319,6 +15335,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -17660,6 +17680,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+                       zval_dtor(free_op2.var);
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -19966,6 +19990,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+                       if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -23407,6 +23435,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -25033,6 +25065,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -26441,6 +26477,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+                       zval_dtor(free_op2.var);
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -27755,6 +27795,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+                       if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -29490,6 +29534,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -32718,6 +32766,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -34831,6 +34883,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+                       zval_dtor(free_op2.var);
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -37003,6 +37059,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+                       if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }
 
@@ -40167,6 +40227,10 @@ static int ZEND_FASTCALL  
ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H
                        }
                }
        } else {
+               if (UNEXPECTED(EG(exception) != NULL)) {
+
+                       HANDLE_EXCEPTION();
+               }
                zend_error_noreturn(E_ERROR, "Call to a member function %s() on 
a non-object", function_name_strval);
        }


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

Reply via email to