ChangeLog 2001-01-14 15:15 UTC+0100

This commit is contained in:
Ryszard Glab
2001-01-14 14:11:28 +00:00
parent 71b35897c3
commit 83ffb5a4bb
5 changed files with 26 additions and 9 deletions

View File

@@ -1,3 +1,14 @@
2001-01-14 15:15 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
*include/hbapi.h
*modified union in 'asRefer' structure
*source/vm/codebloc.c
*source/vm/hvm.c
*source/vm/itemapi.c
*fixed support for detached local variables passed by
the reference
2001-01-13 02:25 UTC-0800 Ron Pinkas <ron@profit-master.com>
* source/compiler/genc.c
* source/compiler/harbour.c

View File

@@ -168,6 +168,7 @@ struct hb_struPointer
struct hb_struRefer
{
union {
struct _HB_CODEBLOCK * block; /* codeblock */
struct _HB_ITEM ** itemsbase; /* static variables */
struct _HB_ITEM ** *itemsbasePtr; /* local variables */
} BasePtr;
@@ -420,7 +421,7 @@ extern HB_CODEBLOCK_PTR hb_codeblockNew( BYTE * pBuffer, USHORT uiLocals, USHORT
extern HB_CODEBLOCK_PTR hb_codeblockMacroNew( BYTE * pBuffer, USHORT usLen );
extern void hb_codeblockDelete( HB_ITEM_PTR pItem ); /* delete a codeblock */
extern PHB_ITEM hb_codeblockGetVar( PHB_ITEM pItem, LONG iItemPos ); /* get local variable referenced in a codeblock */
extern PHB_ITEM hb_codeblockGetRef( PHB_ITEM pItem, PHB_ITEM pRefer ); /* get local variable passed by reference */
extern PHB_ITEM hb_codeblockGetRef( HB_CODEBLOCK_PTR pCBlock, PHB_ITEM pRefer ); /* get local variable passed by reference */
extern void hb_codeblockEvaluate( HB_ITEM_PTR pItem ); /* evaluate a codeblock */
/* memvars subsystem */

View File

@@ -302,11 +302,9 @@ PHB_ITEM hb_codeblockGetVar( PHB_ITEM pItem, LONG iItemPos )
/* Get local variable passed by reference
*/
PHB_ITEM hb_codeblockGetRef( PHB_ITEM pItem, PHB_ITEM pRefer )
PHB_ITEM hb_codeblockGetRef( HB_CODEBLOCK_PTR pCBlock, PHB_ITEM pRefer )
{
HB_CODEBLOCK_PTR pCBlock = pItem->item.asBlock.value;
HB_TRACE(HB_TR_DEBUG, ("hb_codeblockGetRef(%p, %p)", pItem, pRefer));
HB_TRACE(HB_TR_DEBUG, ("hb_codeblockGetRef(%p, %p)", pCBlock, pRefer));
return pCBlock->pLocals - pRefer->item.asRefer.value;
}

View File

@@ -3516,7 +3516,16 @@ static void hb_vmPushLocalByRef( SHORT iLocal )
/* we store its stack offset instead of a pointer to support a dynamic stack */
pTop->item.asRefer.value = iLocal;
pTop->item.asRefer.offset = hb_stackBaseOffset();
pTop->item.asRefer.BasePtr.itemsbasePtr = &hb_stack.pItems;
if( iLocal >= 0 )
pTop->item.asRefer.BasePtr.itemsbasePtr = &hb_stack.pItems;
else
{
/* store direct codeblock address because an item where a codeblock
* is stored can be no longer placed on the eval stack at the time
* of a codeblock evaluation or variable access
*/
pTop->item.asRefer.BasePtr.block = (hb_stackSelfItem())->item.asBlock.value;
}
hb_stackPush();
}

View File

@@ -1143,9 +1143,7 @@ PHB_ITEM hb_itemUnRef( PHB_ITEM pItem )
{
/* local variable referenced in a codeblock
*/
HB_ITEM_PTR *pLocal;
pLocal = *( pItem->item.asRefer.BasePtr.itemsbasePtr ) + pItem->item.asRefer.offset;
pItem = hb_codeblockGetRef( *pLocal, pItem );
pItem = hb_codeblockGetRef( pItem->item.asRefer.BasePtr.block, pItem );
}
}
}