diff options
| author | Dmitry Stogov <dmitry@php.net> | 2006-11-13 10:28:46 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2006-11-13 10:28:46 +0000 |
| commit | f00ee72c3557761836a0518e4d0e615eeccfcb9d (patch) | |
| tree | de63b47bc4eddad9b63a10c5f5824088a5c292f2 /Zend/zend_alloc.c | |
| parent | a27d73b13d215101597d436f183d1e56006e731e (diff) | |
| download | php-git-f00ee72c3557761836a0518e4d0e615eeccfcb9d.tar.gz | |
Fixed incorrect heap corruptiuon detection code
Diffstat (limited to 'Zend/zend_alloc.c')
| -rw-r--r-- | Zend/zend_alloc.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 7ab91d810d..aa4f90cc59 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -666,6 +666,15 @@ static long zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block *b) p = ZEND_MM_NEXT_BLOCK(b); while (1) { + if (ZEND_MM_IS_GUARD_BLOCK(p)) { + ZEND_MM_CHECK_MAGIC(p, MEM_BLOCK_GUARD); + segment = segment->next_segment; + if (!segment) { + break; + } + p = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); + continue; + } q = ZEND_MM_NEXT_BLOCK(p); if (q <= p || (char*)q > (char*)segment + segment->size || @@ -686,14 +695,6 @@ static long zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block *b) zend_mm_panic("zend_mm_heap corrupted"); } } - if (ZEND_MM_IS_GUARD_BLOCK(q)) { - ZEND_MM_CHECK_MAGIC(q, MEM_BLOCK_GUARD); - segment = segment->next_segment; - if (!segment) { - break; - } - q = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); - } p = q; } return leaks; |
