[PHP-CVS] com php-src: Re-fix Bug #65372 (Segfault in gc_zval_possible_root when return reference fails): Zend/zend_vm_def.h Zend/zend_vm_execute.h

2013-08-06 Thread Xinchen Hui
Commit:a831499b4a1029118dc45375e62af42043110ade
Author:Xinchen Hui larue...@php.net Tue, 6 Aug 2013 15:37:20 +0800
Parents:   47d66a0b4ea83bc4e1c9bfaa5c478cd42e28337c
Branches:  PHP-5.4 PHP-5.5 master

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

Log:
Re-fix Bug #65372 (Segfault in gc_zval_possible_root when return reference 
fails)

Missed a zval_copy_ctor there

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

Changed paths:
  M  Zend/zend_vm_def.h
  M  Zend/zend_vm_execute.h


Diff:
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 83e40b5..09d0b21 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2914,6 +2914,7 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, 
CONST|TMP|VAR|CV, ANY)
 
ALLOC_ZVAL(ret);
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
+   zval_copy_ctor(ret);
*EG(return_value_ptr_ptr) = ret;
}
break;
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 339e34b..4917cb6 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -2328,6 +2328,7 @@ static int ZEND_FASTCALL  
ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
 
ALLOC_ZVAL(ret);
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
+   zval_copy_ctor(ret);
*EG(return_value_ptr_ptr) = ret;
}
break;
@@ -6749,6 +6750,7 @@ static int ZEND_FASTCALL  
ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE
 
ALLOC_ZVAL(ret);
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
+   zval_copy_ctor(ret);
*EG(return_value_ptr_ptr) = ret;
}
break;
@@ -11063,6 +11065,7 @@ static int ZEND_FASTCALL  
ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE
 
ALLOC_ZVAL(ret);
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
+   zval_copy_ctor(ret);
*EG(return_value_ptr_ptr) = ret;
}
break;
@@ -27040,6 +27043,7 @@ static int ZEND_FASTCALL  
ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER
 
ALLOC_ZVAL(ret);
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
+   zval_copy_ctor(ret);
*EG(return_value_ptr_ptr) = ret;
}
break;


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



Re: [PHP-CVS] com php-src: Re-fix Bug #65372 (Segfault in gc_zval_possible_root when return reference fails): Zend/zend_vm_def.h Zend/zend_vm_execute.h

2013-08-06 Thread Stas Malyshev
Hi!

 Commit:a831499b4a1029118dc45375e62af42043110ade
 Author:Xinchen Hui larue...@php.net Tue, 6 Aug 2013 15:37:20 
 +0800
 Parents:   47d66a0b4ea83bc4e1c9bfaa5c478cd42e28337c
 Branches:  PHP-5.4 PHP-5.5 master
 
 Link:   
 http://git.php.net/?p=php-src.git;a=commitdiff;h=a831499b4a1029118dc45375e62af42043110ade
 
 Log:
 Re-fix Bug #65372 (Segfault in gc_zval_possible_root when return reference 
 fails)
 
 Missed a zval_copy_ctor there
 
 Bugs:
 https://bugs.php.net/65372
 
 Changed paths:
   M  Zend/zend_vm_def.h
   M  Zend/zend_vm_execute.h
 

We should be adding unit tests for such things, if we have reproducing
script.


-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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