see changelog
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
19991008-20:00 CET Eddie Runia <eddie@runia.com>
|
||||
* include/extend.h
|
||||
uiPrevCls added to BASEARRAY
|
||||
* source/rtl/classes.c
|
||||
PrevCls set with previous class when using Super
|
||||
* source/vm/hvm.c
|
||||
Previous class handle restore _after_ retrieving the method
|
||||
+ tests/inhprob.c
|
||||
Test program
|
||||
|
||||
19991008-15:42 GMT+2 Ryszard Glab <rglab@imid.med.pl>
|
||||
|
||||
*source/rdd/dbcmd.c
|
||||
|
||||
@@ -198,6 +198,7 @@ typedef struct _HB_BASEARRAY
|
||||
ULONG ulLen; /* number of items in the array */
|
||||
USHORT uiHolders; /* number of holders of this array */
|
||||
USHORT uiClass; /* offset to the classes base if it is an object */
|
||||
USHORT uiPrevCls; /* previous class handle */
|
||||
BOOL bSuperCast; /* is it a super cast ? */
|
||||
} BASEARRAY, * PBASEARRAY, * BASEARRAY_PTR;
|
||||
|
||||
|
||||
@@ -1074,6 +1074,7 @@ static HARBOUR hb___msgSuper( void )
|
||||
|
||||
pSuper->item.asArray.value = pNewBase;
|
||||
|
||||
pNewBase->uiPrevCls = pNewBase->uiClass;
|
||||
pNewBase->uiClass = uiSuperCls;
|
||||
pNewBase->uiHolders = 1; /* New item is returned */
|
||||
pNewBase->bSuperCast = TRUE; /* Do not dispose pItems !! */
|
||||
|
||||
@@ -2153,6 +2153,7 @@ void hb_vmDo( USHORT uiParams )
|
||||
LONG wStackBase = hb_stack.pBase - hb_stack.pItems; /* as the stack memory block could change */
|
||||
LONG wItemIndex = pItem - hb_stack.pItems;
|
||||
PHB_ITEM pSelf = hb_stack.pPos - uiParams - 1; /* NIL, OBJECT or BLOCK */
|
||||
PBASEARRAY pSelfBase;
|
||||
PHB_FUNC pFunc;
|
||||
int iStatics = hb_stack.iStatics; /* Return iStatics position */
|
||||
BOOL bDebugPrevState = s_bDebugging;
|
||||
@@ -2187,7 +2188,18 @@ void hb_vmDo( USHORT uiParams )
|
||||
if( pSym == &( hb_symEval ) && IS_BLOCK( pSelf ) )
|
||||
pFunc = pSym->pFunPtr; /* __EVAL method = function */
|
||||
else
|
||||
{
|
||||
pFunc = hb_objGetMethod( pSelf, pSym );
|
||||
if( IS_OBJECT( pSelf ) ) /* Object passed */
|
||||
{
|
||||
pSelfBase = pSelf->item.asArray.value;
|
||||
if( pSelfBase->bSuperCast )
|
||||
{
|
||||
pSelfBase->bSuperCast = FALSE;
|
||||
pSelfBase->uiClass = pSelfBase->uiPrevCls;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( pFunc )
|
||||
pFunc();
|
||||
|
||||
33
harbour/tests/inhprob.prg
Normal file
33
harbour/tests/inhprob.prg
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "hbclass.ch"
|
||||
|
||||
function Main()
|
||||
|
||||
local o := Three():New()
|
||||
|
||||
o:CheckIt()
|
||||
|
||||
return nil
|
||||
|
||||
CLASS One
|
||||
|
||||
METHOD New() INLINE Self
|
||||
|
||||
METHOD Test() INLINE QOut( "One" )
|
||||
|
||||
METHOD CheckIt() INLINE ::Test()
|
||||
|
||||
ENDCLASS
|
||||
|
||||
CLASS Two FROM One
|
||||
|
||||
METHOD Test() INLINE Super:Test()
|
||||
|
||||
METHOD CheckIt() INLINE Super:CheckIt()
|
||||
|
||||
ENDCLASS
|
||||
|
||||
CLASS Three FROM Two
|
||||
|
||||
METHOD Test() INLINE QOut( "Three" )
|
||||
|
||||
ENDCLASS
|
||||
Reference in New Issue
Block a user