Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4812 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69732 invoked by uid 1010); 13 Oct 2003 11:36:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 69708 invoked from network); 13 Oct 2003 11:36:52 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by pb1.pair.com with SMTP; 13 Oct 2003 11:36:52 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h9DBaqM18783 for ; Mon, 13 Oct 2003 07:36:52 -0400 Received: from lacrosse.corp.redhat.com (lacrosse.corp.redhat.com [172.16.52.154]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9DBapr29125 for ; Mon, 13 Oct 2003 07:36:51 -0400 Received: from radish.cambridge.redhat.com (radish.cambridge.redhat.com [172.16.18.90]) by lacrosse.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9DBapJ15823 for ; Mon, 13 Oct 2003 07:36:51 -0400 Received: from radish.cambridge.redhat.com (localhost.localdomain [127.0.0.1]) by radish.cambridge.redhat.com (8.12.10/8.12.7) with ESMTP id h9DBaoSV015284 for ; Mon, 13 Oct 2003 12:36:50 +0100 Received: (from jorton@localhost) by radish.cambridge.redhat.com (8.12.10/8.12.10/Submit) id h9DBaovv015283 for internals@lists.php.net; Mon, 13 Oct 2003 12:36:50 +0100 Date: Mon, 13 Oct 2003 12:36:50 +0100 To: internals@lists.php.net Message-ID: <20031013113650.GD19957@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: [PATCH] Zend _CHECK_MEMORY_LIMIT fix From: jorton@redhat.com (Joe Orton) It looks like the _CHECK_MEMORY_LIMIT macro has one of the conditions reversed: the diff below is rather unreadable, if you read the original code the problem should be obvious: if (file) zend_error("..exhausted (tried...", ...) else zend_error("...exhausted at %s:%d (tried...", ..., file, lineno, ...) gcc 3.3 with -Wall is giving warnings on this macro since it expands to always pass a NULL as the %s argument in some places, but this isn't a real issue when inside an if (NULL) condition. Index: Zend/zend_alloc.c =================================================================== RCS file: /repository/Zend/Attic/zend_alloc.c,v retrieving revision 1.105.4.3 diff -u -r1.105.4.3 zend_alloc.c --- Zend/zend_alloc.c 15 Apr 2003 01:30:46 -0000 1.105.4.3 +++ Zend/zend_alloc.c 13 Oct 2003 11:21:27 -0000 @@ -70,9 +70,9 @@ if (AG(memory_limit)+1048576 > AG(allocated_memory) - rs) { \ AG(memory_limit) = AG(allocated_memory) + 1048576; \ if (file) { \ - zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", php_mem_limit, s); \ - } else { \ zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", php_mem_limit, file, lineno, s); \ + } else { \ + zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", php_mem_limit, s); \ } \ } else { \ if (file) { \