Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute_API.c

From: Date: Mon, 19 Jul 2004 14:17:44 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute_API.c
References: 1 2 3 4 5  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2766@lists.php.net to get a copy of this message
Is this actually a problem? I thought malloc(0) works? Andi At 10:18 AM 7/19/2004 +0100, Wez Furlong wrote:
Yeah, that's the one I was hinting at. --Wez. On Mon, 19 Jul 2004 11:41:24 +0400, Antony Dovgal <tony2001@phpclub.net> wrote: On Sun, 18 Jul 2004 18:51:20 +0100 Wez Furlong <wez@thebrainroom.com> wrote:
Build a debug build and make install; the memory tracker reports several
         "free 0 bytes" messages.
There is another one for the (controversial) do_alloca->emalloc change to, but I didn't want to get into that one....
Wez, it seems, that there is the same problem in zend_execute.c. See the diff: Index: zend_execute.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute.c,v retrieving revision 1.654 diff -u -r1.654 zend_execute.c
--- zend_execute.c      19 Jul 2004 07:19:01 -0000      1.654
+++ zend_execute.c      19 Jul 2004 07:36:01 -0000
@@ -1330,7 +1330,9 @@
        }
#define RETURN_FROM_EXECUTE_LOOP(execute_data)
                               \-       efree(EX(Ts));
      \+       if (EX(Ts)) {
                                                         \+
efree(EX(Ts));
                                   \+       }
             \        EG(in_execution) = EX(original_in_execution);
                                             \
EG(current_execute_data) = EX(prev_execute_data);
                       \        return 1; /* CHECK_ME */
@@ -1349,7 +1351,10 @@
        /* Initialize execute_data */
        EX(fbc) = NULL;
        EX(object) = NULL;
-       EX(Ts) = (temp_variable *) safe_emalloc(sizeof(temp_variable),
op_array->T, 0);+       EX(Ts) = NULL;
+       if (op_array->T) {
+               EX(Ts) = (temp_variable *)
safe_emalloc(sizeof(temp_variable), op_array->T, 0);+       }
        EX(op_array) = op_array;
        EX(original_in_execution) = EG(in_execution);
        EX(prev_execute_data) = EG(current_execute_data);
Here you can find valgrind's output: http://lists.php.net/php.internals/11162 --- WBR, Antony Dovgal aka tony2001 tony2001@phpclub.net || antony@dovgal.com -- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.zend-engine.cvs (#2766) next »