2014-10-08 18:00 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* src/vm/arrays.c
    ! added protection against internal error when ACOPY() is executed
      with the same array passed as source and target without any indexes
      which can force item move. Now ACOPY() works like in Cl*pper.
This commit is contained in:
Przemysław Czerpak
2014-10-08 18:00:07 +02:00
parent 02e9546d90
commit 11df11dd7a
2 changed files with 13 additions and 5 deletions

View File

@@ -10,6 +10,12 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2014-10-08 18:00 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/vm/arrays.c
! added protection against internal error when ACOPY() is executed
with the same array passed as source and target without any indexes
which can force item move. Now ACOPY() works like in Cl*pper.
2014-10-08 11:06 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbamf/amfdec.c
! simplified and fixed datetime decoding.

View File

@@ -1452,12 +1452,14 @@ HB_BOOL hb_arrayCopy( PHB_ITEM pSrcArray, PHB_ITEM pDstArray, HB_SIZE * pnStart,
if( nTarget <= nDstLen )
{
#endif
if( pDstBaseArray->pItems + nTarget != pSrcBaseArray->pItems + nStart )
{
if( nCount > nDstLen - nTarget )
nCount = nDstLen - nTarget + 1;
if( nCount > nDstLen - nTarget )
nCount = nDstLen - nTarget + 1;
for( nTarget--, nStart--; nCount > 0; nCount--, nStart++, nTarget++ )
hb_itemCopy( pDstBaseArray->pItems + nTarget, pSrcBaseArray->pItems + nStart );
for( nTarget--, nStart--; nCount > 0; nCount--, nStart++, nTarget++ )
hb_itemCopy( pDstBaseArray->pItems + nTarget, pSrcBaseArray->pItems + nStart );
}
}
}