laruence                                 Sat, 21 Jan 2012 17:13:53 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=322541

Log:
Fixed bug #60825 (Segfault when running symfony 2 tests)

Bug: https://bugs.php.net/60825 (Critical) Segfault when running symfony 2 tests
      
Changed paths:
    U   php/php-src/trunk/NEWS
    A   php/php-src/trunk/Zend/tests/bug60825.phpt
    U   php/php-src/trunk/Zend/zend_vm_def.h
    U   php/php-src/trunk/Zend/zend_vm_execute.h

Modified: php/php-src/trunk/NEWS
===================================================================
--- php/php-src/trunk/NEWS      2012-01-21 12:05:47 UTC (rev 322540)
+++ php/php-src/trunk/NEWS      2012-01-21 17:13:53 UTC (rev 322541)
@@ -8,6 +8,7 @@
 - Core:
   . Fixed bug #60573 (type hinting with "self" keyword causes weird errors).
     (Laruence)
+  . Fixed bug #60825 (Segfault when running symfony 2 tests). (Laruence)

 - cURL:
   . Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,

Added: php/php-src/trunk/Zend/tests/bug60825.phpt
===================================================================
--- php/php-src/trunk/Zend/tests/bug60825.phpt                          (rev 0)
+++ php/php-src/trunk/Zend/tests/bug60825.phpt  2012-01-21 17:13:53 UTC (rev 
322541)
@@ -0,0 +1,18 @@
+--TEST--
+Bug #60825 (Segfault when running symfony 2 tests)
+--DESCRIPTION--
+run this with valgrind
+--FILE--
+<?php
+if (isset($loaded)) {
+    $loaded = true;
+       class test {
+               public function __toString() {
+                       return __FILE__;
+               }
+       }
+       $a = new test;
+       require_once $a;
+}
+?>
+--EXPECT--

Modified: php/php-src/trunk/Zend/zend_vm_def.h
===================================================================
--- php/php-src/trunk/Zend/zend_vm_def.h        2012-01-21 12:05:47 UTC (rev 
322540)
+++ php/php-src/trunk/Zend/zend_vm_def.h        2012-01-21 17:13:53 UTC (rev 
322541)
@@ -3700,7 +3700,7 @@
        inc_filename = GET_OP1_ZVAL_PTR(BP_VAR_R);

        if (inc_filename->type!=IS_STRING) {
-               ZVAL_COPY_VALUE(&tmp_inc_filename, inc_filename);
+               INIT_PZVAL_COPY(&tmp_inc_filename, inc_filename);
                zval_copy_ctor(&tmp_inc_filename);
                convert_to_string(&tmp_inc_filename);
                inc_filename = &tmp_inc_filename;

Modified: php/php-src/trunk/Zend/zend_vm_execute.h
===================================================================
--- php/php-src/trunk/Zend/zend_vm_execute.h    2012-01-21 12:05:47 UTC (rev 
322540)
+++ php/php-src/trunk/Zend/zend_vm_execute.h    2012-01-21 17:13:53 UTC (rev 
322541)
@@ -2529,7 +2529,7 @@
        inc_filename = opline->op1.zv;

        if (inc_filename->type!=IS_STRING) {
-               ZVAL_COPY_VALUE(&tmp_inc_filename, inc_filename);
+               INIT_PZVAL_COPY(&tmp_inc_filename, inc_filename);
                zval_copy_ctor(&tmp_inc_filename);
                convert_to_string(&tmp_inc_filename);
                inc_filename = &tmp_inc_filename;
@@ -6859,7 +6859,7 @@
        inc_filename = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 
TSRMLS_CC);

        if (inc_filename->type!=IS_STRING) {
-               ZVAL_COPY_VALUE(&tmp_inc_filename, inc_filename);
+               INIT_PZVAL_COPY(&tmp_inc_filename, inc_filename);
                zval_copy_ctor(&tmp_inc_filename);
                convert_to_string(&tmp_inc_filename);
                inc_filename = &tmp_inc_filename;
@@ -11216,7 +11216,7 @@
        inc_filename = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 
TSRMLS_CC);

        if (inc_filename->type!=IS_STRING) {
-               ZVAL_COPY_VALUE(&tmp_inc_filename, inc_filename);
+               INIT_PZVAL_COPY(&tmp_inc_filename, inc_filename);
                zval_copy_ctor(&tmp_inc_filename);
                convert_to_string(&tmp_inc_filename);
                inc_filename = &tmp_inc_filename;
@@ -27068,7 +27068,7 @@
        inc_filename = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var 
TSRMLS_CC);

        if (inc_filename->type!=IS_STRING) {
-               ZVAL_COPY_VALUE(&tmp_inc_filename, inc_filename);
+               INIT_PZVAL_COPY(&tmp_inc_filename, inc_filename);
                zval_copy_ctor(&tmp_inc_filename);
                convert_to_string(&tmp_inc_filename);
                inc_filename = &tmp_inc_filename;

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

Reply via email to