From fff94bccbfa53e135374a6ae70717cf891adc1c8 Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Mon, 11 Oct 1999 07:55:26 +0000 Subject: [PATCH] *** empty log message *** --- harbour/include/extend.h | 2 ++ harbour/source/rtl/classes.c | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/harbour/include/extend.h b/harbour/include/extend.h index 87bc553eb4..9420192cf9 100644 --- a/harbour/include/extend.h +++ b/harbour/include/extend.h @@ -197,7 +197,9 @@ typedef struct _HB_BASEARRAY PHB_ITEM pItems; /* pointer to the array items */ ULONG ulLen; /* number of items in the array */ USHORT uiHolders; /* number of holders of this array */ + USHORT uiPrevHolders; /* for fixing after access super */ USHORT uiClass; /* offset to the classes base if it is an object */ + USHORT uiPrevCls; /* for fixing after access super */ BOOL bSuperCast; /* is it a super cast ? */ } BASEARRAY, * PBASEARRAY, * BASEARRAY_PTR; diff --git a/harbour/source/rtl/classes.c b/harbour/source/rtl/classes.c index 0e2572a1cc..312825bdaf 100644 --- a/harbour/source/rtl/classes.c +++ b/harbour/source/rtl/classes.c @@ -502,7 +502,9 @@ HARBOUR HB___CLSNEW( void ) pNewCls->uiDatas = pSprCls->uiDatas + hb_parni( 2 ); pNewCls->uiMethods = pSprCls->uiMethods; - pNewCls->pClassDatas = hb_arrayClone( pSprCls->pClassDatas ); + /* pNewCls->pClassDatas = hb_arrayClone( pSprCls->pClassDatas ); */ + pNewCls->pClassDatas = hb_itemNew( NULL ); + hb_itemCopy( pNewCls->pClassDatas, pSprCls->pClassDatas ); pNewCls->pInlines = hb_arrayClone( pSprCls->pInlines ); @@ -1068,16 +1070,17 @@ static HARBOUR hb___msgSuper( void ) PBASEARRAY pNewBase = ( PBASEARRAY ) hb_xgrab( sizeof( BASEARRAY ) ); USHORT uiSuperCls = s_pMethod->uiData; /* Get handle of superclass */ - memcpy( pSuper, pObject, sizeof( HB_ITEM ) ); - /* Allocate new structures */ + memcpy( pSuper, pObject, sizeof( HB_ITEM ) ); /* Allocate new structures */ memcpy( pNewBase, pObject->item.asArray.value, sizeof( BASEARRAY ) ); pSuper->item.asArray.value = pNewBase; - pNewBase->uiClass = uiSuperCls; - pNewBase->uiHolders = 1; /* New item is returned */ - pNewBase->bSuperCast = TRUE; /* Do not dispose pItems !! */ - /* A bit dirty, but KISS. */ + pNewBase->uiPrevCls = pNewBase->uiClass; + pNewBase->uiPrevHolders = pNewBase->uiHolders; + pNewBase->uiClass = uiSuperCls; + pNewBase->uiHolders = 1; /* New item is returned */ + pNewBase->bSuperCast = TRUE; /* Do not dispose pItems !! */ + /* A bit dirty, but KISS. */ hb_itemCopy( &hb_stack.Return, pSuper ); hb_itemRelease( pSuper ); }