[xdebug-dev] xdebug xdebug/xdebug.c - MFH: Fixed display of unused returned variables from functions in PHP 5.3.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Fri, 26 Dec 2008 13:02:29 +0100

Date: Fri Dec 26 13:02:29 CET 2008
User: Derick Rethans
Directory: xdebug

Log Message:
[0.50]
- MFH: Fixed display of unused returned variables from functions in PHP 5.3.
#- This is the "famous" return_value_ptr_ptr fix.

Modified files:
           xdebug/xdebug.c (version: 1.400.2.19)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.400.2.18
retrieving revision 1.400.2.19
diff -u -r1.400.2.18 -r1.400.2.19
--- xdebug/xdebug.c:1.400.2.18 Wed Dec 03 21:09:02 2008 GMT
+++ xdebug/xdebug.c Fri Dec 26 11:02:29 2008 GMT
@@ -1374,6 +1374,7 @@
         int function_nr = 0;
         xdebug_llist_element *le;
         int eval_id = 0;
+ zval *return_val = NULL;
 
 
         if (XG(no_exec) == 1) {
@@ -1552,6 +1553,11 @@
         if (XG(profiler_enabled)) {
                 xdebug_profiler_function_user_begin(fse TSRMLS_CC);
         }
+
+ if (EG(return_value_ptr_ptr) == NULL) {
+ EG(return_value_ptr_ptr) = &return_val;
+ }
+
         xdebug_old_execute(op_array TSRMLS_CC);
 
         if (XG(profiler_enabled)) {
@@ -1570,6 +1576,11 @@
                 }
         }
 
+ if (return_val) {
+ zval_ptr_dtor(&return_val);
+ EG(return_value_ptr_ptr) = NULL;
+ }
+
         /* Check for return breakpoints */
         if (XG(remote_enabled) && XG(breakpoints_allowed)) {
                 if (!handle_breakpoints(fse, XDEBUG_BRK_FUNC_RETURN)) {
Received on Fri Dec 26 2008 - 13:02:32 GMT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST