diff options
author | James E. King, III <jking@apache.org> | 2017-02-06 12:57:21 -0500 |
---|---|---|
committer | James E. King, III <jking@apache.org> | 2017-02-06 12:57:21 -0500 |
commit | 3a8bbbd4a68fb28f2b33a7ee9e81ba3dd4a929a5 (patch) | |
tree | 14f8f3ce7f6f1204dc3c2c522bc43c00a52f7b16 /lib/php | |
parent | a3d6be906b339ce4e55e8fb8d98ff11480792949 (diff) | |
download | thrift-3a8bbbd4a68fb28f2b33a7ee9e81ba3dd4a929a5.tar.gz |
THRIFT-3896 fix map type with string key can not access deserialized by php extension
Client: php
Patch: feidong@anjuke.com
This closes #1062
Diffstat (limited to 'lib/php')
-rw-r--r-- | lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp | 4 | ||||
-rw-r--r-- | lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp index a0de64503..f9b3ad76e 100644 --- a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp +++ b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp @@ -543,7 +543,7 @@ void binary_deserialize(int8_t thrift_typeID, PHPInputTransport& transport, zval } else { if (Z_TYPE_P(key) != IS_STRING) convert_to_string(key); - zend_hash_update(return_value->value.ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &value, sizeof(zval *), NULL); + zend_symtable_update(return_value->value.ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &value, sizeof(zval *), NULL); } zval_ptr_dtor(&key); } @@ -589,7 +589,7 @@ void binary_deserialize(int8_t thrift_typeID, PHPInputTransport& transport, zval } else { if (Z_TYPE_P(key) != IS_STRING) convert_to_string(key); - zend_hash_update(return_value->value.ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &value, sizeof(zval *), NULL); + zend_symtable_update(return_value->value.ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &value, sizeof(zval *), NULL); } zval_ptr_dtor(&key); } diff --git a/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp b/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp index 59fa30a74..13cdf2213 100644 --- a/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp +++ b/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp @@ -594,7 +594,7 @@ void binary_deserialize(int8_t thrift_typeID, PHPInputTransport& transport, zval zend_hash_index_update(Z_ARR_P(return_value), Z_LVAL(key), &value); } else { if (Z_TYPE(key) != IS_STRING) convert_to_string(&key); - zend_hash_update(Z_ARR_P(return_value), Z_STR(key), &value); + zend_symtable_update(Z_ARR_P(return_value), Z_STR(key), &value); } } return; // return_value already populated @@ -634,7 +634,7 @@ void binary_deserialize(int8_t thrift_typeID, PHPInputTransport& transport, zval zend_hash_index_update(Z_ARR_P(return_value), Z_LVAL(key), &value); } else { if (Z_TYPE(key) != IS_STRING) convert_to_string(&key); - zend_hash_update(Z_ARR_P(return_value), Z_STR(key), &value); + zend_symtable_update(Z_ARR_P(return_value), Z_STR(key), &value); } } return; |