summaryrefslogtreecommitdiff
path: root/ext/intl/dateformat/dateformat_parse.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-06-28 21:09:07 +0800
committerXinchen Hui <laruence@php.net>2014-06-28 21:09:07 +0800
commitd01e06e18a96dc6c2844198ee67e77ab7021456b (patch)
treeb0ce02db4b653fc32a3b4b6d25d2657b4bd93fff /ext/intl/dateformat/dateformat_parse.c
parenta1426c62d515f74125de3a6b6cffc2004c81ba5c (diff)
downloadphp-git-d01e06e18a96dc6c2844198ee67e77ab7021456b.tar.gz
Fixed refernce handling
Diffstat (limited to 'ext/intl/dateformat/dateformat_parse.c')
-rw-r--r--ext/intl/dateformat/dateformat_parse.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c
index 9930778546..f981afb6a8 100644
--- a/ext/intl/dateformat/dateformat_parse.c
+++ b/ext/intl/dateformat/dateformat_parse.c
@@ -182,7 +182,8 @@ PHP_FUNCTION(datefmt_localtime)
/* Fetch the object. */
DATE_FORMAT_METHOD_FETCH_OBJECT;
- if(z_parse_pos) {
+ if (z_parse_pos) {
+ ZVAL_DEREF(z_parse_pos);
convert_to_long(z_parse_pos);
parse_pos = (int32_t)Z_LVAL_P(z_parse_pos);
if(parse_pos > text_len) {
@@ -190,7 +191,7 @@ PHP_FUNCTION(datefmt_localtime)
}
}
internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value TSRMLS_CC);
- if(z_parse_pos) {
+ if (z_parse_pos) {
zval_dtor(z_parse_pos);
ZVAL_LONG(z_parse_pos, parse_pos);
}