com php-src: Fixed extract() support IS_INDIRECT: Zend/ze nd_hash.h ext/standard/array.c
| From: | Dmitry Stogov | Date: | Wed, 26 Mar 2014 18:52:28 +0000 |
| Subject: | com php-src: Fixed extract() support IS_INDIRECT: Zend/ze nd_hash.h ext/standard/array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77542@lists.php.net to get a copy of this message | ||
Commit: f3272bf7acdd10ad0cea048c056d75ef39ce3f51
Author: Dmitry Stogov <dmitry@zend.com> Wed, 26 Mar 2014 22:52:28 +0400
Parents: de6a76d16e40b342131fb929fba7213aeb406868
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f3272bf7acdd10ad0cea048c056d75ef39ce3f51
Log:
Fixed extract() support IS_INDIRECT
Changed paths:
M Zend/zend_hash.h
M ext/standard/array.c
Diff:
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index b991830...41bb305 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -261,6 +261,16 @@ static inline zval *zend_hash_find_ind(const HashTable *ht, zend_string *key)
}
+static inline int *zend_hash_exists_ind(const HashTable *ht, zend_string *key)
+{
+ zval *zv;
+
+ zv = zend_hash_find(ht, key);
+ return zv && (Z_TYPE_P(zv) != IS_INDIRECT ||
+ Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF);
+}
+
+
static inline zval *zend_hash_str_find_ind(const HashTable *ht, const char *str, int len)
{
zval *zv;
diff --git a/ext/standard/array.c b/ext/standard/array.c
index e2a2f02..b14fb2c 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1359,7 +1359,7 @@ PHP_FUNCTION(extract)
var_exists = 0;
if (key_type == HASH_KEY_IS_STRING) {
- var_exists = zend_hash_exists(&EG(active_symbol_table)->ht, var_name);
+ var_exists = zend_hash_exists_ind(&EG(active_symbol_table)->ht, var_name);
} else if (key_type == HASH_KEY_IS_LONG && (extract_type == EXTR_PREFIX_ALL ||
extract_type == EXTR_PREFIX_INVALID)) {
zval num;