From 8448bbf0b9b2c73f6f75691633b0003d60aa955d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 8 Jan 2003 15:01:04 +0000 Subject: [PATCH] Fixes. [SVN r16795] --- sp_debug_hooks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sp_debug_hooks.cpp b/sp_debug_hooks.cpp index 3d5fb15..458810f 100644 --- a/sp_debug_hooks.cpp +++ b/sp_debug_hooks.cpp @@ -155,7 +155,7 @@ static void scan_and_count(void const * area, size_t size, map_type const & m, s { unsigned char const * p = static_cast(area); - for(size_t n = 0; n < size; p += pointer_align, n += pointer_align) + for(size_t n = 0; n + sizeof(shared_ptr_layout) <= size; p += pointer_align, n += pointer_align) { shared_ptr_layout const * q = reinterpret_cast(p); @@ -171,7 +171,7 @@ static bool scan_and_mark(void const * area, size_t size, map_type const & m, st bool updated = false; unsigned char const * p = static_cast(area); - for(size_t n = 0; n < size; p += pointer_align, n += pointer_align) + for(size_t n = 0; n + sizeof(shared_ptr_layout) <= size; p += pointer_align, n += pointer_align) { shared_ptr_layout const * q = reinterpret_cast(p);