From 99dec6927cba10e7c3352b191ac4297a3f61f25c Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 29 Nov 2003 19:05:14 +0000 Subject: Fixed bug #26463 (Incorrect handling of semicolons after heredoc) --- ext/tokenizer/tokenizer.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ext/tokenizer/tokenizer.c') diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c index 5c7346c4ba..e4c0678ec2 100644 --- a/ext/tokenizer/tokenizer.c +++ b/ext/tokenizer/tokenizer.c @@ -361,7 +361,12 @@ static void tokenize(zval *return_value TSRMLS_DC) MAKE_STD_ZVAL(keyword); array_init(keyword); add_next_index_long(keyword, token_type); - add_next_index_stringl(keyword, zendtext, zendleng, 1); + if (token_type == T_END_HEREDOC) { + add_next_index_stringl(keyword, Z_STRVAL(token), Z_STRLEN(token), 1); + efree(Z_STRVAL(token)); + } else { + add_next_index_stringl(keyword, zendtext, zendleng, 1); + } add_next_index_zval(return_value, keyword); } else { add_next_index_stringl(return_value, zendtext, zendleng, 1); @@ -369,9 +374,6 @@ static void tokenize(zval *return_value TSRMLS_DC) if (destroy && Z_TYPE(token) != IS_NULL) { zval_dtor(&token); } - if (token_type == T_END_HEREDOC) { - efree(Z_STRVAL(token)); - } ZVAL_NULL(&token); } } -- cgit v1.2.1