Advertisement
Guest User

bug69756

a guest
Jun 5th, 2015
593
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.38 KB | None
  1. diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
  2. index bb0a2ff..5cd1b0b 100644
  3. --- a/Zend/zend_hash.c
  4. +++ b/Zend/zend_hash.c
  5. @@ -71,7 +71,7 @@ static void _zend_is_inconsistent(const HashTable *ht, const char *file, int lin
  6.  
  7.  #define HASH_PROTECT_RECURSION(ht)
  8.             \
  9.     if ((ht)->u.flags & HASH_FLAG_APPLY_PROTECTION) {
  10.     \
  11. -       if ((ht)->u.flags >= (3 << 8)) {
  12.             \
  13. +       if (((ht)->u.flags & ZEND_HASH_APPLY_COUNT_MASK) >= (3 << 8)) {
  14.                         \
  15.             zend_error_noreturn(E_ERROR, "Nesting level too deep - recursive dependency?");\
  16.         }
  17.                             \
  18.         ZEND_HASH_INC_APPLY_COUNT(ht);
  19.             \
  20. diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
  21. index 78a04ce..3ae3e45 100644
  22. --- a/Zend/zend_hash.h
  23. +++ b/Zend/zend_hash.h
  24. @@ -845,8 +845,9 @@ static zend_always_inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht,
  25.  #define ZEND_HASH_APPLY_PROTECTION(ht) \
  26.     ((ht)->u.flags & HASH_FLAG_APPLY_PROTECTION)
  27.  
  28. -#define ZEND_HASH_APPLY_SHIFT 8
  29. -#define ZEND_HASH_GET_APPLY_COUNT(ht) ((ht)->u.flags >> ZEND_HASH_APPLY_SHIFT)
  30. +#define ZEND_HASH_APPLY_SHIFT         8
  31. +#define ZEND_HASH_APPLY_COUNT_MASK    0xff00
  32. +#define ZEND_HASH_GET_APPLY_COUNT(ht) (((ht)->u.flags & ZEND_HASH_APPLY_COUNT_MASK) >> ZEND_HASH_APPLY_SHIFT)
  33.  #define ZEND_HASH_INC_APPLY_COUNT(ht) ((ht)->u.flags += (1 << ZEND_HASH_APPLY_SHIFT))
  34.  #define ZEND_HASH_DEC_APPLY_COUNT(ht) ((ht)->u.flags -= (1 << ZEND_HASH_APPLY_SHIFT))
Advertisement
RAW Paste Data Copied
Advertisement