com php-src: Fixed retval with zend_call_method: ext/in tl/calendar/calendar_methods.cpp ext/intl/timezone/timezo ne_methods.cpp

From: Date: Sun, 29 Jun 2014 11:07:06 +0000
Subject: com php-src: Fixed retval with zend_call_method: ext/in tl/calendar/calendar_methods.cpp ext/intl/timezone/timezo ne_methods.cpp
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-79127@lists.php.net to get a copy of this message
Commit: a94ec141fe35b2e6351f55f8ca796ec4ef332de5 Author: Xinchen Hui <laruence@php.net> Sun, 29 Jun 2014 19:07:06 +0800 Parents: 477f565f80c0c396a99903081851ea6bf2223e0f Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a94ec141fe35b2e6351f55f8ca796ec4ef332de5 Log: Fixed retval with zend_call_method Changed paths: M ext/intl/calendar/calendar_methods.cpp M ext/intl/timezone/timezone_methods.cpp Diff: diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp index 02dfe5e..b67bd4b 100644 --- a/ext/intl/calendar/calendar_methods.cpp +++ b/ext/intl/calendar/calendar_methods.cpp @@ -1141,7 +1141,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time) zval *zv_arg, zv_tmp, *zv_datetime = NULL, - *zv_timestamp = NULL; + zv_timestamp; php_date_obj *datetime; char *locale_str = NULL; int locale_str_len; @@ -1178,11 +1178,12 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time) goto error; } - zend_call_method_with_0_params(zv_datetime, php_date_get_date_ce(), NULL, "gettimestamp", zv_timestamp); - if (!zv_timestamp || Z_TYPE_P(zv_timestamp) != IS_LONG) { + zend_call_method_with_0_params(zv_datetime, php_date_get_date_ce(), NULL, "gettimestamp", &zv_timestamp); + if (Z_TYPE(zv_timestamp) != IS_LONG) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlcal_from_date_time: bad DateTime; call to " "DateTime::getTimestamp() failed", 0 TSRMLS_CC); + zval_ptr_dtor(&zv_timestamp); goto error; } @@ -1208,7 +1209,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time) "error creating ICU Calendar object", 0 TSRMLS_CC); goto error; } - cal->setTime(((UDate)Z_LVAL_P(zv_timestamp)) * 1000., status); + cal->setTime(((UDate)Z_LVAL(zv_timestamp)) * 1000., status); if (U_FAILURE(status)) { /* time zone was adopted by cal; should not be deleted here */ delete cal; @@ -1223,9 +1224,6 @@ error: if (zv_datetime && zv_datetime != zv_arg) { zval_ptr_dtor(zv_datetime); } - if (zv_timestamp) { - zval_ptr_dtor(zv_timestamp); - } } U_CFUNC PHP_FUNCTION(intlcal_to_date_time) diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods..cpp index bef69ba..c98a036 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -436,7 +436,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_id) id_us.getBuffer(), id_us.length(), TIMEZONE_ERROR_CODE_P(to)); INTL_METHOD_CHECK_STATUS(to, "intltz_get_id: Could not convert id to UTF-8"); - RETURN_STRINGL(id, id_len); + RETVAL_STRINGL(id, id_len); //??? efree(id); }

« previous php.cvs (#79127) next »