diff --git a/harbour/ChangeLog b/harbour/ChangeLog index eca040a0fd..2e598e646b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,10 @@ +2001-07-23 22:35 UTC+0100 Lubos Janica + * classes.c + Fixed function __CLSNEW. + Changed variable USHORT uiSize to ULONG ulSize + This fix random GPFs in function hb_clsDictRealloc by creating + classes. + 2001-07-23 21:29 UTC+0100 Viktor Szakats * source/rtl/tbrowse.prg diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index 57574a9107..3870fb0a58 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -1079,7 +1079,9 @@ HB_FUNC( __CLSADDMSG ) HB_FUNC( __CLSNEW ) { PCLASS pNewCls; - USHORT uiSize; + ULONG ulSize; /* USHORT is small. Maximum 409 methods. In some + cases it is enough. This eliminate random GPFs + in this function for big classes */ PHB_ITEM pahSuper; USHORT i, uiSuper; @@ -1183,9 +1185,9 @@ HB_FUNC( __CLSNEW ) if( i == 1 ) { - uiSize = ( USHORT ) ( pNewCls->uiHashKey * BUCKET * sizeof( METHOD ) ); - pNewCls->pMethods = ( PMETHOD ) hb_xgrab( uiSize ); - memset( pNewCls->pMethods, 0, uiSize ); + ulSize = pNewCls->uiHashKey * BUCKET * sizeof( METHOD ); + pNewCls->pMethods = ( PMETHOD ) hb_xgrab( ulSize ); + memset( pNewCls->pMethods, 0, ulSize ); pNewCls->pFunError = pSprCls->pFunError; } @@ -2333,4 +2335,4 @@ void hb_mthAddTime( void * pMethod, ULONG ulClockTicks ) { if( pMethod != NULL ) ( ( PMETHOD ) pMethod )->ulTime += ulClockTicks; -} \ No newline at end of file +}