com php-src: Some changes were lost in the merge commit of #66091: ext/date/php_date.c

From: Date: Wed, 13 Aug 2014 12:57:10 +0000
Subject: com php-src: Some changes were lost in the merge commit of #66091: ext/date/php_date.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-79837@lists.php.net to get a copy of this message
Commit: 7fbc99e39021b937458752f18456848587966b84 Author: Tjerk Meesters <datibbaw@php.net> Wed, 13 Aug 2014 20:57:10 +0800 Parents: e4905b38b78a4fa9414fd92a60c8273ceb010bcd Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7fbc99e39021b937458752f18456848587966b84 Log: Some changes were lost in the merge commit of #66091 Bugs: https://bugs.php.net/66091 Changed paths: M ext/date/php_date.c Diff: diff --git a/ext/date/php_date..c b/ext/date/php_date.c index 1f7ee75..39b25d9 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2667,14 +2667,19 @@ PHP_FUNCTION(date_create_immutable) zval *timezone_object = NULL; char *time_str = NULL; int time_str_len = 0; + zval datetime_object; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { RETURN_FALSE; } - php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC); - if (!php_date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) { + php_date_instantiate(date_ce_immutable, &datetime_object TSRMLS_CC); + if (!php_date_initialize(zend_object_store_get_object(&datetime_object TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) { + zval_dtor(&datetime_object); RETURN_FALSE; + } else { + zval *datetime_object_ptr = &datetime_object; + RETVAL_ZVAL(datetime_object_ptr, 0, 0); } } /* }}} */ @@ -2712,14 +2717,19 @@ PHP_FUNCTION(date_create_immutable_from_format) zval *timezone_object = NULL; char *time_str = NULL, *format_str = NULL; int time_str_len = 0, format_str_len = 0; + zval datetime_object; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { RETURN_FALSE; } - php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC); - if (!php_date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) { + php_date_instantiate(date_ce_immutable, &datetime_object TSRMLS_CC); + if (!php_date_initialize(zend_object_store_get_object(&datetime_object TSRMLS_CC), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) { + zval_dtor(&datetime_object); RETURN_FALSE; + } else { + zval *datetime_object_ptr = &datetime_object; + RETVAL_ZVAL(datetime_object_ptr, 0, 0); } } /* }}} */

« previous php.cvs (#79837) next »