diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ebc6439b81..4493237ba1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-07-04 04:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/vm/classes.c + * do not allocate self calss casting method when class name cannot + be used as method + 2007-07-04 04:35 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/classes.c ! fixed typo in adding messages with HB_OO_MSG_PROPERTY flag diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index 4f735c6717..9ecb5e59f3 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -2766,19 +2766,21 @@ static USHORT hb_clsNew( const char * szClassName, USHORT uiDatas, } /* add self class casting */ - pMethod = hb_clsAllocMsg( pNewCls, pNewCls->pClassSym ); - if( ! pMethod ) - return 0; - if( pMethod->pMessage == NULL ) + if( hb_stricmp( pNewCls->szName, pNewCls->pClassSym->pSymbol->szName ) == 0 ) { - pNewCls->uiMethods++; - pMethod->pMessage = pNewCls->pClassSym; - pMethod->uiSprClass = s_uiClasses; - pMethod->uiScope = HB_OO_CLSTP_EXPORTED; - pMethod->pFuncSym = &s___msgSuper; - pMethod->uiOffset = pNewCls->uiDatas; + pMethod = hb_clsAllocMsg( pNewCls, pNewCls->pClassSym ); + if( ! pMethod ) + return 0; + if( pMethod->pMessage == NULL ) + { + pNewCls->uiMethods++; + pMethod->pMessage = pNewCls->pClassSym; + pMethod->uiSprClass = s_uiClasses; + pMethod->uiScope = HB_OO_CLSTP_EXPORTED; + pMethod->pFuncSym = &s___msgSuper; + pMethod->uiOffset = pNewCls->uiDatas; + } } - pNewCls->uiDataFirst = pNewCls->uiDatas; pNewCls->uiDatas += uiDatas;