logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

cvs: ZendEngine2(PHP_5_2) / zend_vm_def.h zend_vm_execute.h /tests bug3607: msg#00034

Subject: cvs: ZendEngine2(PHP_5_2) / zend_vm_def.h zend_vm_execute.h /tests bug36071.phpt bug42817.phpt bug42818.phpt
iliaa           Thu Oct  4 23:23:45 2007 UTC

  Added files:                 (Branch: PHP_5_2)
    /ZendEngine2/tests  bug42817.phpt 

  Modified files:              
    /ZendEngine2        zend_vm_def.h zend_vm_execute.h 
    /ZendEngine2/tests  bug42818.phpt bug36071.phpt 
  Log:
  MFB: Fixed bug #42817 (clone() on a non-object does not result in a fatal
  error)
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.59.2.29.2.50&r2=1.59.2.29.2.51&diff_format=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.59.2.29.2.50 
ZendEngine2/zend_vm_def.h:1.59.2.29.2.51
--- ZendEngine2/zend_vm_def.h:1.59.2.29.2.50    Wed Oct  3 09:47:24 2007
+++ ZendEngine2/zend_vm_def.h   Thu Oct  4 23:23:41 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_vm_def.h,v 1.59.2.29.2.50 2007/10/03 09:47:24 dmitry Exp $ */
+/* $Id: zend_vm_def.h,v 1.59.2.29.2.51 2007/10/04 23:23:41 iliaa Exp $ */
 
 /* If you change this file, please regenerate the zend_vm_execute.h and
  * zend_vm_opcodes.h files by running:
@@ -2531,10 +2531,10 @@
        zend_object_clone_obj_t clone_call;
 
        if (!obj || Z_TYPE_P(obj) != IS_OBJECT) {
-               zend_error(E_WARNING, "__clone method called on non-object");
+               zend_error_noreturn(E_ERROR, "__clone method called on 
non-object");
                EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
                EX_T(opline->result.u.var).var.ptr->refcount++;
-               FREE_OP1();
+               FREE_OP1_IF_VAR();
                ZEND_VM_NEXT_OPCODE();
        }
 
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.62.2.30.2.51&r2=1.62.2.30.2.52&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.62.2.30.2.51 
ZendEngine2/zend_vm_execute.h:1.62.2.30.2.52
--- ZendEngine2/zend_vm_execute.h:1.62.2.30.2.51        Wed Oct  3 09:47:24 2007
+++ ZendEngine2/zend_vm_execute.h       Thu Oct  4 23:23:41 2007
@@ -1837,7 +1837,7 @@
        zend_object_clone_obj_t clone_call;
 
        if (!obj || Z_TYPE_P(obj) != IS_OBJECT) {
-               zend_error(E_WARNING, "__clone method called on non-object");
+               zend_error_noreturn(E_ERROR, "__clone method called on 
non-object");
                EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
                EX_T(opline->result.u.var).var.ptr->refcount++;
 
@@ -4412,10 +4412,10 @@
        zend_object_clone_obj_t clone_call;
 
        if (!obj || Z_TYPE_P(obj) != IS_OBJECT) {
-               zend_error(E_WARNING, "__clone method called on non-object");
+               zend_error_noreturn(E_ERROR, "__clone method called on 
non-object");
                EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
                EX_T(opline->result.u.var).var.ptr->refcount++;
-               zval_dtor(free_op1.var);
+
                ZEND_VM_NEXT_OPCODE();
        }
 
@@ -7559,7 +7559,7 @@
        zend_object_clone_obj_t clone_call;
 
        if (!obj || Z_TYPE_P(obj) != IS_OBJECT) {
-               zend_error(E_WARNING, "__clone method called on non-object");
+               zend_error_noreturn(E_ERROR, "__clone method called on 
non-object");
                EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
                EX_T(opline->result.u.var).var.ptr->refcount++;
                if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -14719,7 +14719,7 @@
        zend_object_clone_obj_t clone_call;
 
        if (!obj || Z_TYPE_P(obj) != IS_OBJECT) {
-               zend_error(E_WARNING, "__clone method called on non-object");
+               zend_error_noreturn(E_ERROR, "__clone method called on 
non-object");
                EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
                EX_T(opline->result.u.var).var.ptr->refcount++;
 
@@ -19631,7 +19631,7 @@
        zend_object_clone_obj_t clone_call;
 
        if (!obj || Z_TYPE_P(obj) != IS_OBJECT) {
-               zend_error(E_WARNING, "__clone method called on non-object");
+               zend_error_noreturn(E_ERROR, "__clone method called on 
non-object");
                EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
                EX_T(opline->result.u.var).var.ptr->refcount++;
 
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug42818.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: ZendEngine2/tests/bug42818.phpt
diff -u ZendEngine2/tests/bug42818.phpt:1.1.2.1 
ZendEngine2/tests/bug42818.phpt:1.1.2.2
--- ZendEngine2/tests/bug42818.phpt:1.1.2.1     Wed Oct  3 09:47:25 2007
+++ ZendEngine2/tests/bug42818.phpt     Thu Oct  4 23:23:43 2007
@@ -5,5 +5,5 @@
 $foo = clone(array());
 ?>
 --EXPECTF--
-Warning: __clone method called on non-object in %sbug42818.php on line 2
+Fatal error: __clone method called on non-object in %sbug42818.php on line 2
 
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug36071.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u
Index: ZendEngine2/tests/bug36071.phpt
diff -u ZendEngine2/tests/bug36071.phpt:1.1.2.1 
ZendEngine2/tests/bug36071.phpt:1.1.2.1.2.1
--- ZendEngine2/tests/bug36071.phpt:1.1.2.1     Thu Jan 19 07:23:32 2006
+++ ZendEngine2/tests/bug36071.phpt     Thu Oct  4 23:23:43 2007
@@ -6,8 +6,6 @@
 <?php
 $a = clone 0;
 $a[0]->b = 0;
-echo "ok\n";
 ?>
 --EXPECTF--
-Warning: __clone method called on non-object in %sbug36071.php on line 2
-ok
\ No newline at end of file
+Fatal error: __clone method called on non-object in %sbug36071.php on line 2
\ No newline at end of file

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug42817.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug42817.phpt
+++ ZendEngine2/tests/bug42817.phpt

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




<Prev in Thread] Current Thread [Next in Thread>