correct zend_hash_find_wrapper for php7

pull/10/head
yuqing 2016-08-02 09:44:41 +08:00
parent 60cd0565e5
commit a56d0af695
1 changed files with 6 additions and 3 deletions

View File

@ -171,9 +171,12 @@ typedef size_t zend_size_t;
static inline int zend_hash_find_wrapper(HashTable *ht, char *key, int key_len, static inline int zend_hash_find_wrapper(HashTable *ht, char *key, int key_len,
zval **value) zval **value)
{ {
zval zkey; zend_string *zkey;
ZVAL_STRINGL(&zkey, key, key_len - 1); bool use_heap;
*value = zend_hash_find(ht, Z_STR(zkey));
ZSTR_ALLOCA_INIT(zkey, key, key_len - 1, use_heap);
*value = zend_hash_find(ht, zkey);
ZSTR_ALLOCA_FREE(zkey, use_heap);
return (*value != NULL ? SUCCESS : FAILURE); return (*value != NULL ? SUCCESS : FAILURE);
} }