From 62fe2c2913df6c77bbdd3094882ad94570ac62a0 Mon Sep 17 00:00:00 2001 From: Eddie Runia Date: Sat, 22 May 1999 16:28:25 +0000 Subject: [PATCH] See changelog --- harbour/ChangeLog | 8 ++++++++ harbour/source/rtl/arrays.c | 10 +++++----- harbour/tests/working/ainstest.prg | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 08b2f03b39..16e2ac86b4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,11 @@ +19990522-17:25 CET Eddie Runia + * source/vm/hvm.c + 'Array' bug possibly resolved. + * source/rtl/arrays.c + aClone does not loose memory anymore + * tests/working/ainstest.prg + test for aClone added. + 19990522-15:55 CET Eddie Runia * docs/hrb.faq Clean up diff --git a/harbour/source/rtl/arrays.c b/harbour/source/rtl/arrays.c index a21265f14d..4c3087dceb 100644 --- a/harbour/source/rtl/arrays.c +++ b/harbour/source/rtl/arrays.c @@ -6,6 +6,7 @@ #include PITEM hb_itemNew( PITEM ); +PITEM hb_itemArrayPut( PITEM , ULONG , PITEM ); extern STACK stack; extern SYMBOL symEval; @@ -540,14 +541,13 @@ PITEM hb_arrayClone( PITEM pSrcArray ) for ( ulCount = 0; ulCount < ulSrcLen; ulCount ++ ) { - PITEM pSrcItem = pSrcBaseArray->pItems + ulCount; - PITEM pDstItem = pDstBaseArray->pItems + ulCount; + PITEM pSrcItem = pSrcBaseArray->pItems + ulCount; if ( pSrcItem->wType == IT_ARRAY ) - ItemCopy( pDstItem, hb_arrayClone( pSrcItem ) ); + hb_itemArrayPut( pDstArray, ulCount, hb_arrayClone( pSrcItem ) ); else - ItemCopy( pDstItem, pSrcItem ); - } + hb_itemArrayPut( pDstArray, ulCount, pSrcItem ); + } return pDstArray; } else diff --git a/harbour/tests/working/ainstest.prg b/harbour/tests/working/ainstest.prg index e8edf04b64..0f8fc170a2 100644 --- a/harbour/tests/working/ainstest.prg +++ b/harbour/tests/working/ainstest.prg @@ -10,7 +10,7 @@ function Main() local aSecond local aMore - aFirst := { 1,2,4 } + aFirst := aClone( { 1,2,4 } ) aIns( aFirst, 3 ) aFirst[3] = "3" QQOut( "Testing aIns .. " )