- 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
}
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;
}
}
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;
}
}
#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;
<ST_IN_SCRIPTING>"/**"{WHITESPACE} {
CG(comment_start_line) = CG(zend_lineno);
+ RESET_DOC_COMMENT();
BEGIN(ST_DOC_COMMENT);
yymore();
}
}
<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);