|
version 1.1.1.1, 2012/02/21 23:47:52
|
version 1.1.1.3, 2013/07/22 01:32:15
|
|
Line 2
|
Line 2
|
| +----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| | Zend Engine | |
| Zend Engine | |
| +----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | | | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | |
| +----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| | This source file is subject to version 2.00 of the Zend license, | |
| This source file is subject to version 2.00 of the Zend license, | |
| | that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
|
Line 60 typedef struct bucket {
|
Line 60 typedef struct bucket {
|
| struct bucket *pListLast; |
struct bucket *pListLast; |
| struct bucket *pNext; |
struct bucket *pNext; |
| struct bucket *pLast; |
struct bucket *pLast; |
| char arKey[1]; /* Must be last element */ | const char *arKey; |
| } Bucket; |
} Bucket; |
| |
|
| typedef struct _hashtable { |
typedef struct _hashtable { |
|
Line 83 typedef struct _hashtable {
|
Line 83 typedef struct _hashtable {
|
| |
|
| |
|
| typedef struct _zend_hash_key { |
typedef struct _zend_hash_key { |
| char *arKey; | const char *arKey; |
| uint nKeyLength; |
uint nKeyLength; |
| ulong h; |
ulong h; |
| } zend_hash_key; |
} zend_hash_key; |
|
Line 304 END_EXTERN_C()
|
Line 304 END_EXTERN_C()
|
| #define ZEND_INIT_SYMTABLE_EX(ht, n, persistent) \ |
#define ZEND_INIT_SYMTABLE_EX(ht, n, persistent) \ |
| zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent) |
zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent) |
| |
|
| #define ZEND_HANDLE_NUMERIC(key, length, func) do { \ | #define ZEND_HANDLE_NUMERIC_EX(key, length, idx, func) do { \ |
| register const char *tmp = key; \ |
register const char *tmp = key; \ |
| \ |
\ |
| if (*tmp == '-') { \ |
if (*tmp == '-') { \ |
|
Line 312 END_EXTERN_C()
|
Line 312 END_EXTERN_C()
|
| } \ |
} \ |
| if (*tmp >= '0' && *tmp <= '9') { /* possibly a numeric index */ \ |
if (*tmp >= '0' && *tmp <= '9') { /* possibly a numeric index */ \ |
| const char *end = key + length - 1; \ |
const char *end = key + length - 1; \ |
| ulong idx; \ |
|
| \ |
\ |
| if ((*end != '\0') /* not a null terminated string */ \ |
if ((*end != '\0') /* not a null terminated string */ \ |
| || (*tmp == '0' && length > 2) /* numbers with leading zeros */ \ |
|| (*tmp == '0' && length > 2) /* numbers with leading zeros */ \ |
|
Line 331 END_EXTERN_C()
|
Line 330 END_EXTERN_C()
|
| if (idx-1 > LONG_MAX) { /* overflow */ \ |
if (idx-1 > LONG_MAX) { /* overflow */ \ |
| break; \ |
break; \ |
| } \ |
} \ |
| idx = (ulong)(-(long)idx); \ | idx = 0 - idx; \ |
| } else if (idx > LONG_MAX) { /* overflow */ \ |
} else if (idx > LONG_MAX) { /* overflow */ \ |
| break; \ |
break; \ |
| } \ |
} \ |
| return func; \ | func; \ |
| } \ |
} \ |
| } \ |
} \ |
| |
} while (0) |
| |
|
| |
#define ZEND_HANDLE_NUMERIC(key, length, func) do { \ |
| |
ulong idx; \ |
| |
\ |
| |
ZEND_HANDLE_NUMERIC_EX(key, length, idx, return func); \ |
| } while (0) |
} while (0) |
| |
|
| static inline int zend_symtable_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest) \ |
static inline int zend_symtable_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest) \ |