From caadc6fa2e19996dce0842a60ac8e2c83a411d09 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Tue, 14 Oct 2008 23:39:35 +0000 Subject: [PATCH] 2008-10-15 01:39 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/hvm.c ! clear HVM stack return value before use in initialization code --- harbour/ChangeLog | 4 ++++ harbour/source/vm/hvm.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 573df9eaae..178342824a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,10 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-10-15 01:39 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/vm/hvm.c + ! clear HVM stack return value before use in initialization code + 2008-10-15 01:04 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * source/debug/dbgtobj.prg * source/debug/dbgbrwsr.prg diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 3edcc73dc4..5288ea4af6 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -6013,6 +6013,8 @@ static void hb_vmTSVReference( PHB_ITEM pStatic ) /* Use hb_stackReturnItem() as temporary item holder */ pRefer = hb_stackReturnItem(); + if( HB_IS_COMPLEX( pRefer ) ) + hb_itemClear( pRefer ); pRefer->type = HB_IT_BYREF | HB_IT_EXTREF; pRefer->item.asExtRef.value = ( void * ) pTSVRef; pRefer->item.asExtRef.func = &s_TSVExtRef; @@ -7739,6 +7741,8 @@ BOOL hb_vmMsgReference( PHB_ITEM pObject, PHB_DYNS pMessage, PHB_DYNS pAccMsg ) hb_itemMove( &pMsgRef->object, pObject ); pRefer = hb_stackReturnItem(); + if( HB_IS_COMPLEX( pRefer ) ) + hb_itemClear( pRefer ); pRefer->type = HB_IT_BYREF | HB_IT_EXTREF; pRefer->item.asExtRef.value = ( void * ) pMsgRef; pRefer->item.asExtRef.func = &s_MsgExtRef; @@ -7866,7 +7870,7 @@ static void hb_vmMsgIndexReference( PHB_ITEM pRefer, PHB_ITEM pObject, PHB_ITEM pMsgIdxRef->object.type = HB_IT_NIL; pMsgIdxRef->index.type = HB_IT_NIL; hb_itemCopy( &pMsgIdxRef->object, HB_IS_STRING( pObject ) ? pRefer : pObject ); - hb_itemCopy( &pMsgIdxRef->index, pIndex ); + hb_itemMove( &pMsgIdxRef->index, pIndex ); pIndex->type = HB_IT_BYREF | HB_IT_EXTREF; pIndex->item.asExtRef.value = ( void * ) pMsgIdxRef;