[PHP-CVS] com php-src: Fixed merge wrongly: Zend/zend_vm_def.h Zend/zend_vm_execute.h

2013-06-08 Thread Xinchen Hui
Commit:e14800dd46ce9adbaa696fec6b2f1741bbc3abba
Author:Xinchen Hui  Sun, 9 Jun 2013 14:24:05 +0800
Parents:   3cc891bf3a27eb13a101da3391b75cfa77a117ae
Branches:  PHP-5.4

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

Log:
Fixed merge wrongly

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 40e2e42..15cef71 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2685,7 +2685,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
zval_ptr_dtor(&ret->var.ptr);
}
} else if (RETURN_VALUE_USED(opline)) {
-   EX_T(opline->result.u.var).var.ptr = NULL;
+   EX_T(opline->result.var).var.ptr = NULL;
}
} else if (fbc->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index ad6d708..4982cc2 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -649,7 +649,7 @@ static int ZEND_FASTCALL 
zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
zval_ptr_dtor(&ret->var.ptr);
}
} else if (RETURN_VALUE_USED(opline)) {
-   EX_T(opline->result.u.var).var.ptr = NULL;
+   EX_T(opline->result.var).var.ptr = NULL;
}
} else if (fbc->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.5': Zend/zend_vm_def.h Zend/zend_vm_execute.h

2013-06-08 Thread Xinchen Hui
Commit:46005788304ea406dbc1f5f21cc76456fecc8594
Author:Xinchen Hui  Sun, 9 Jun 2013 13:50:06 +0800
Parents:   2c0f09540e18371387eb291906f19b8b94e1ca5a 
6139358804ce41df3bbe54a7e8df6c6eb303c8b6
Branches:  master

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

Log:
Merge branch 'PHP-5.5'

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


Diff:



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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_vm_def.h Zend/zend_vm_execute.h

2013-06-08 Thread Xinchen Hui
Commit:f372e00332c06f0e659dd755ecf7ca8e920dee42
Author:Xinchen Hui  Sun, 9 Jun 2013 13:49:26 +0800
Parents:   bccacb630858f28370acbf014c8514709e3d689a 
3cc891bf3a27eb13a101da3391b75cfa77a117ae
Branches:  PHP-5.5 master

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

Log:
Merge branch 'PHP-5.4' into PHP-5.5

Conflicts:
Zend/zend_vm_def.h

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

diff --cc Zend/zend_vm_def.h
index 386641a,40e2e42..ca62dde
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@@ -1829,268 -1819,6 +1829,270 @@@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VA
ZEND_VM_NEXT_OPCODE();
  }
  
 +ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
 +{
 +  zend_bool nested = EX(nested);
 +  zend_op_array *op_array = EX(op_array);
 +
 +  EG(current_execute_data) = EX(prev_execute_data);
 +  EG(opline_ptr) = NULL;
 +  if (!EG(active_symbol_table)) {
 +  i_free_compiled_variables(execute_data);
 +  }
 +
 +  zend_vm_stack_free((char*)execute_data - 
(ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T) TSRMLS_CC);
 +
 +  if ((op_array->fn_flags & ZEND_ACC_CLOSURE) && op_array->prototype) {
 +  zval_ptr_dtor((zval**)&op_array->prototype);
 +  }
 +
 +  if (nested) {
 +  execute_data = EG(current_execute_data);
 +  }
 +  if (nested) {
 +  USE_OPLINE
 +
 +  LOAD_REGS();
 +  LOAD_OPLINE();
 +  if (UNEXPECTED(opline->opcode == ZEND_INCLUDE_OR_EVAL)) {
 +
 +  EX(function_state).function = (zend_function *) 
EX(op_array);
 +  EX(function_state).arguments = NULL;
 +
 +  EG(opline_ptr) = &EX(opline);
 +  EG(active_op_array) = EX(op_array);
 +  EG(return_value_ptr_ptr) = EX(original_return_value);
 +  destroy_op_array(op_array TSRMLS_CC);
 +  efree(op_array);
 +  if (UNEXPECTED(EG(exception) != NULL)) {
 +  zend_throw_exception_internal(NULL TSRMLS_CC);
 +  HANDLE_EXCEPTION_LEAVE();
 +  }
 +
 +  ZEND_VM_INC_OPCODE();
 +  ZEND_VM_LEAVE();
 +  } else {
 +  EG(opline_ptr) = &EX(opline);
 +  EG(active_op_array) = EX(op_array);
 +  EG(return_value_ptr_ptr) = EX(original_return_value);
 +  if (EG(active_symbol_table)) {
 +  
zend_clean_and_cache_symbol_table(EG(active_symbol_table) TSRMLS_CC);
 +  }
 +  EG(active_symbol_table) = EX(symbol_table);
 +
 +  EX(function_state).function = (zend_function *) 
EX(op_array);
 +  EX(function_state).arguments = NULL;
 +
 +  if (EG(This)) {
 +  if (UNEXPECTED(EG(exception) != NULL) && 
EX(call)->is_ctor_call) {
 +  if (EX(call)->is_ctor_result_used) {
 +  Z_DELREF_P(EG(This));
 +  }
 +  if (Z_REFCOUNT_P(EG(This)) == 1) {
 +  
zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
 +  }
 +  }
 +  zval_ptr_dtor(&EG(This));
 +  }
 +  EG(This) = EX(current_this);
 +  EG(scope) = EX(current_scope);
 +  EG(called_scope) = EX(current_called_scope);
 +
 +  EX(call)--;
 +
 +  zend_vm_stack_clear_multiple(1 TSRMLS_CC);
 +
 +  if (UNEXPECTED(EG(exception) != NULL)) {
 +  zend_throw_exception_internal(NULL TSRMLS_CC);
 +  if (RETURN_VALUE_USED(opline) && 
EX_T(opline->result.var).var.ptr) {
 +  
zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
 +  }
 +  HANDLE_EXCEPTION_LEAVE();
 +  }
 +
 +  ZEND_VM_INC_OPCODE();
 +  ZEND_VM_LEAVE();
 +  }
 +  }
 +  ZEND_VM_RETURN();
 +}
 +
 +ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
 +{
 +  USE_OPLINE
 +  zend_bool should_change_scope = 0;
 +  zend_function *fbc = EX(function_state).function;
 +
 +  SAVE_OPLINE();
 +  EX(object) = EX(call)->object;
 +  if (UNEXPECTED((fbc->common.fn_flags & 
(ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) {
 +  if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 
0)) {
 +   

[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: Zend/zend_vm_def.h Zend/zend_vm_execute.h

2013-06-08 Thread Xinchen Hui
Commit:ab22fda7e52f097297f1dcdf06f474cea858adc0
Author:Xinchen Hui  Sun, 9 Jun 2013 13:35:45 +0800
Parents:   a7e25bdd486c28958c2db2f28c9fda63bb938405 
e8f004d54252e0130b88131bdc46a41ed365c51e
Branches:  PHP-5.4 PHP-5.5 master

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

Log:
Merge branch 'PHP-5.3' into PHP-5.4

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


Diff:
diff --cc Zend/zend_vm_def.h
index eed65e3,d471f39..40e2e42
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@@ -2682,27 -2325,26 +2682,29 @@@ ZEND_VM_HELPER(zend_do_fcall_common_hel
}
  
if (!RETURN_VALUE_USED(opline)) {
 -  
zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
 +  zval_ptr_dtor(&ret->var.ptr);
}
+   } else if (RETURN_VALUE_USED(opline)) {
+   EX_T(opline->result.u.var).var.ptr = NULL;
}
 -  } else if (EX(function_state).function->type == ZEND_USER_FUNCTION) {
 +  } else if (fbc->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);
EG(active_symbol_table) = NULL;
 -  EG(active_op_array) = &EX(function_state).function->op_array;
 +  EG(active_op_array) = &fbc->op_array;
EG(return_value_ptr_ptr) = NULL;
 -  if (RETURN_VALUE_USED(opline)) {
 -  EG(return_value_ptr_ptr) = 
&EX_T(opline->result.u.var).var.ptr;
 -  EX_T(opline->result.u.var).var.ptr = NULL;
 -  EX_T(opline->result.u.var).var.ptr_ptr = 
&EX_T(opline->result.u.var).var.ptr;
 -  EX_T(opline->result.u.var).var.fcall_returned_reference 
= EX(function_state).function->common.return_reference;
 +  if (RETURN_VALUE_USED(opline)) {
 +  temp_variable *ret = &EX_T(opline->result.var);
 +
 +  ret->var.ptr = NULL;
 +  EG(return_value_ptr_ptr) = &ret->var.ptr;
 +  ret->var.ptr_ptr = &ret->var.ptr;
 +  ret->var.fcall_returned_reference = 
(fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
}
  
 -  if (zend_execute == execute && !EG(exception)) {
 -  EX(call_opline) = opline;
 -  ZEND_VM_ENTER();
 +  if (EXPECTED(zend_execute == execute)) {
 +  if (EXPECTED(EG(exception) == NULL)) {
 +  ZEND_VM_ENTER();
 +  }
} else {
zend_execute(EG(active_op_array) TSRMLS_CC);
}
diff --cc Zend/zend_vm_execute.h
index 18b3f47,993b822..ad6d708
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@@ -646,27 -325,26 +646,29 @@@ static int ZEND_FASTCALL zend_do_fcall_
}
  
if (!RETURN_VALUE_USED(opline)) {
 -  
zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
 +  zval_ptr_dtor(&ret->var.ptr);
}
+   } else if (RETURN_VALUE_USED(opline)) {
+   EX_T(opline->result.u.var).var.ptr = NULL;
}
 -  } else if (EX(function_state).function->type == ZEND_USER_FUNCTION) {
 +  } else if (fbc->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);
EG(active_symbol_table) = NULL;
 -  EG(active_op_array) = &EX(function_state).function->op_array;
 +  EG(active_op_array) = &fbc->op_array;
EG(return_value_ptr_ptr) = NULL;
if (RETURN_VALUE_USED(opline)) {
 -  EG(return_value_ptr_ptr) = 
&EX_T(opline->result.u.var).var.ptr;
 -  EX_T(opline->result.u.var).var.ptr = NULL;
 -  EX_T(opline->result.u.var).var.ptr_ptr = 
&EX_T(opline->result.u.var).var.ptr;
 -  EX_T(opline->result.u.var).var.fcall_returned_reference 
= EX(function_state).function->common.return_reference;
 +  temp_variable *ret = &EX_T(opline->result.var);
 +
 +  ret->var.ptr = NULL;
 +  EG(return_value_ptr_ptr) = &ret->var.ptr;
 +  ret->var.ptr_ptr = &ret->var.ptr;
 +  ret->var.fcall_returned_reference = 
(fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
}
  
 -  if (zend_execute == execute && !EG(exception)) {
 -  EX(call_opline) = opline;
 -  ZEND_VM_ENTER();
 +  if (EXPECTED(zend_execute == execute)) {
 +  if (EXPECTED(EG(exception) == NULL)) {
 +   

[PHP-CVS] com php-src: Update NEWS: NEWS

2013-06-08 Thread Xinchen Hui
Commit:3cc891bf3a27eb13a101da3391b75cfa77a117ae
Author:Xinchen Hui  Sun, 9 Jun 2013 13:39:40 +0800
Parents:   ab22fda7e52f097297f1dcdf06f474cea858adc0
Branches:  PHP-5.4 PHP-5.5 master

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

Log:
Update NEWS

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index e1aa27a..78bcb00 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ PHP 
   NEWS
 ?? ??? 2013, PHP 5.4.17
 
 - Core:
+  . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence)
   . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence)
   . Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol)


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



[PHP-CVS] com php-src: Update NEWS: NEWS

2013-06-08 Thread Xinchen Hui
Commit:6139358804ce41df3bbe54a7e8df6c6eb303c8b6
Author:Xinchen Hui  Sun, 9 Jun 2013 13:49:43 +0800
Parents:   f372e00332c06f0e659dd755ecf7ca8e920dee42
Branches:  PHP-5.5 master

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

Log:
Update NEWS

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index de1f6d0..d4ad9cc 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,9 @@
 PHPNEWS
 |||
 ?? ??? 2013, PHP 5.5.0 Release Candidate 4
+
 - Core:
+  . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence)
   . Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol)
 
 06 Jun 2013, PHP 5.5.0 Release Candidate 3


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



[PHP-CVS] com php-src: Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC): NEWS Zend/tests/bug64966.phpt Zend/zend_vm_def.h Zend/zend_vm_execute.h

2013-06-08 Thread Xinchen Hui
Commit:e8f004d54252e0130b88131bdc46a41ed365c51e
Author:Xinchen Hui  Sun, 9 Jun 2013 13:20:40 +0800
Parents:   1aee7ad63672747bd941f169ef42bed5765137e0
Branches:  PHP-5.3 PHP-5.4 PHP-5.5 master

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

Log:
Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC)

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

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


Diff:
diff --git a/NEWS b/NEWS
index fc0842f..7f54f39 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,9 @@
 PHPNEWS
 |||
 ?? ??? 2013, PHP 5.3.27
+
 - Core:
+  . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence)
   . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence)
   . Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol)
 
diff --git a/Zend/tests/bug64966.phpt b/Zend/tests/bug64966.phpt
new file mode 100644
index 000..27fec3b
--- /dev/null
+++ b/Zend/tests/bug64966.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #64966 (segfault in zend_do_fcall_common_helper_SPEC)
+--FILE--
+b();
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'Exception' in %sbug64966.php:3
+Stack trace:
+#0 [internal function]: {closure}(4096, 'Argument 1 pass...', 
'/home/huixinche...', 6, Array)
+#1 %sbug64966.php(6): iterator_apply('')
+#2 %sbug64966.php(12): test('iterator_apply')
+#3 %sbug64966.php(17): A->b()
+#4 {main}
+  thrown in %sbug64966.php on line 3
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 02566f3..d471f39 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2327,6 +2327,8 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
if (!RETURN_VALUE_USED(opline)) {

zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
}
+   } else if (RETURN_VALUE_USED(opline)) {
+   EX_T(opline->result.u.var).var.ptr = NULL;
}
} else if (EX(function_state).function->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index f6220b0..993b822 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -327,6 +327,8 @@ static int ZEND_FASTCALL 
zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
if (!RETURN_VALUE_USED(opline)) {

zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
}
+   } else if (RETURN_VALUE_USED(opline)) {
+   EX_T(opline->result.u.var).var.ptr = NULL;
}
} else if (EX(function_state).function->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);


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