Repository: thrift Updated Branches: refs/heads/master a3d6be906 -> 3a8bbbd4a
THRIFT-3896 fix map type with string key can not access deserialized by php extension Client: php Patch: feid...@anjuke.com This closes #1062 Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/3a8bbbd4 Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/3a8bbbd4 Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/3a8bbbd4 Branch: refs/heads/master Commit: 3a8bbbd4a68fb28f2b33a7ee9e81ba3dd4a929a5 Parents: a3d6be9 Author: James E. King, III <jk...@apache.org> Authored: Mon Feb 6 12:57:21 2017 -0500 Committer: James E. King, III <jk...@apache.org> Committed: Mon Feb 6 12:57:21 2017 -0500 ---------------------------------------------------------------------- lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp | 4 ++-- lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/3a8bbbd4/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp ---------------------------------------------------------------------- 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 a0de645..f9b3ad7 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); } http://git-wip-us.apache.org/repos/asf/thrift/blob/3a8bbbd4/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp ---------------------------------------------------------------------- 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 59fa30a..13cdf22 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;