cvs: ZendEngine2(PHP_5_0) / zend_compile.c zend_compile.h zend_language_scanner.l php-src NEWS

From: Date: Tue, 07 Jun 2005 18:07:53 +0000
Subject: cvs: ZendEngine2(PHP_5_0) / zend_compile.c zend_compile.h zend_language_scanner.l php-src NEWS
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-3751@lists.php.net to get a copy of this message
dmitry Tue Jun 7 14:07:53 2005 EDT Modified files: (Branch: PHP_5_0) /php-src NEWS /ZendEngine2 zend_compile.c zend_compile.h zend_language_scanner.l Log: Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when called via STDIN) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.424&r2=1.1760.2.425&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.424 php-src/NEWS:1.1760.2.425 --- php-src/NEWS:1.1760.2.424 Tue Jun 7 03:03:18 2005 +++ php-src/NEWS Tue Jun 7 14:07:51 2005 @@ -158,6 +158,8 @@ - Fixed bug #28605 (Need to use -[m]ieee option for Alpha CPUs). (Jani) - Fixed bug #27598 (list() array key assignment causes HUGE memory leak). (Dmitry) +- Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when + called via STDIN). (Dmitry) - Fixed bug #22836 (returning reference to uninitialized variable). (Dmitry) 31 Mar 2005, PHP 5.0.4 http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.567.2.20&r2=1.567.2.21&ty=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.567.2.20 ZendEngine2/zend_compile.c:1.567.2.21 --- ZendEngine2/zend_compile.c:1.567.2.20 Fri Jun 3 11:02:08 2005 +++ ZendEngine2/zend_compile.c Tue Jun 7 14:07:52 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.567.2.20 2005/06/03 15:02:08 dmitry Exp $ */ +/* $Id: zend_compile.c,v 1.567.2.21 2005/06/07 18:07:52 dmitry Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -1079,9 +1079,10 @@ } if (CG(doc_comment)) { - CG(active_op_array)->doc_comment = estrndup(CG(doc_comment), CG(doc_comment_len)); + CG(active_op_array)->doc_comment = CG(doc_comment); CG(active_op_array)->doc_comment_len = CG(doc_comment_len); - RESET_DOC_COMMENT(); + CG(doc_comment) = NULL; + CG(doc_comment_len) = 0; } } @@ -2534,9 +2535,10 @@ CG(implementing_class) = opline->result; if (CG(doc_comment)) { - CG(active_class_entry)->doc_comment = estrndup(CG(doc_comment), CG(doc_comment_len)); + CG(active_class_entry)->doc_comment = CG(doc_comment); CG(active_class_entry)->doc_comment_len = CG(doc_comment_len); - RESET_DOC_COMMENT(); + CG(doc_comment) = NULL; + CG(doc_comment_len) = 0; } } http://cvs.php.net/diff.php/ZendEngine2/zend_compile.h?r1=1.284.2.2&r2=1.284.2.3&ty=u Index: ZendEngine2/zend_compile.h diff -u ZendEngine2/zend_compile.h:1.284.2.2 ZendEngine2/zend_compile.h:1.284.2.3 --- ZendEngine2/zend_compile.h:1.284.2.2 Wed Sep 15 20:44:12 2004 +++ ZendEngine2/zend_compile.h Tue Jun 7 14:07:52 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.h,v 1.284.2.2 2004/09/16 00:44:12 andi Exp $ */ +/* $Id: zend_compile.h,v 1.284.2.3 2005/06/07 18:07:52 dmitry Exp $ */ #ifndef ZEND_COMPILE_H #define ZEND_COMPILE_H @@ -41,10 +41,13 @@ #define DEC_BPC(op_array) if (CG(interactive)) { ((op_array)->backpatch_count--); } #define HANDLE_INTERACTIVE() if (CG(interactive)) { execute_new_code(TSRMLS_C); } -#define RESET_DOC_COMMENT() \ - { \ - CG(doc_comment) = NULL; \ - CG(doc_comment_len) = 0; \ +#define RESET_DOC_COMMENT() \ + { \ + if (CG(doc_comment)) { \ + efree(CG(doc_comment)); \ + CG(doc_comment) = NULL; \ + } \ + CG(doc_comment_len) = 0; \ } typedef struct _zend_op_array zend_op_array; http://cvs.php.net/diff.php/ZendEngine2/zend_language_scanner.l?r1=1.111.2.8&r2=1.111.2.9&ty=u Index: ZendEngine2/zend_language_scanner.l diff -u ZendEngine2/zend_language_scanner.l:1.111.2.8 ZendEngine2/zend_language_scanner.l:1.111.2.9 --- ZendEngine2/zend_language_scanner.l:1.111.2.8 Mon Mar 7 11:48:12 2005 +++ ZendEngine2/zend_language_scanner.l Tue Jun 7 14:07:52 2005 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_language_scanner.l,v 1.111.2.8 2005/03/07 16:48:12 zeev Exp $ */ +/* $Id: zend_language_scanner.l,v 1.111.2.9 2005/06/07 18:07:52 dmitry Exp $ */ #define yyleng SCNG(yy_leng) #define yytext SCNG(yy_text) @@ -1464,6 +1464,7 @@ <ST_IN_SCRIPTING>"/**"{WHITESPACE} { CG(comment_start_line) = CG(zend_lineno); + RESET_DOC_COMMENT(); BEGIN(ST_DOC_COMMENT); yymore(); } @@ -1480,7 +1481,7 @@ } <ST_DOC_COMMENT>"*/" { - CG(doc_comment) = yytext; /* no copying - intentional */ + CG(doc_comment) = estrndup(yytext, yyleng); CG(doc_comment_len) = yyleng; HANDLE_NEWLINES(yytext, yyleng); BEGIN(ST_IN_SCRIPTING);

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