From 852ab436f319d962c870c8a44225fd7ccc20fece Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Thu, 26 Nov 2009 11:18:25 +0000 Subject: [PATCH] 2009-11-26 12:18 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/vm/fm.c ! fixed stupid typo I made just before recent commit which caused GPF when not all mspaces where initialized --- harbour/ChangeLog | 5 +++++ harbour/src/vm/fm.c | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8ef8c5d4ff..68a5472ed9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-11-26 12:18 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/vm/fm.c + ! fixed stupid typo I made just before recent commit which caused + GPF when not all mspaces where initialized + 2009-11-26 02:27 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/hbqt_slots.cpp * contrib/hbqt/hbqt_slots.h diff --git a/harbour/src/vm/fm.c b/harbour/src/vm/fm.c index c56ebc73af..443039a960 100644 --- a/harbour/src/vm/fm.c +++ b/harbour/src/vm/fm.c @@ -421,7 +421,7 @@ static void * hb_mspace_update( void * pAlloc, int iCount ) { PHB_MSPACE pm = ( PHB_MSPACE ) pAlloc; - if( pm->count > iCount ) + if( pm && pm->count > iCount ) { pAlloc = ( void * ) hb_mspace_alloc(); pm->count--; @@ -518,10 +518,13 @@ void hb_xclean( void ) for( i = imax = icount = 0; i < HB_MSPACE_COUNT; ++i ) { - icount += s_mspool[ i ].count; - if( imax < s_mspool[ i ].count ) - imax = s_mspool[ i ].count; - mspace_trim( s_mspool[ i ].ms, 0 ); + if( s_mspool[ i ].ms ) + { + icount += s_mspool[ i ].count; + if( imax < s_mspool[ i ].count ) + imax = s_mspool[ i ].count; + mspace_trim( s_mspool[ i ].ms, 0 ); + } } icount = ( icount + HB_MSPACE_COUNT - 1 ) / HB_MSPACE_COUNT; if( imax > icount )