ChangeLog 20000502-14:55 GMT+1
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
20000502-14:55 GMT+1 Ryszard Glab <rglab@imid.med.pl>
|
||||
|
||||
*source/vm/hvm.c
|
||||
* fixed bug during accessing a constant arrays caused by
|
||||
the optimization - { 1, 2, 3 }[ n ]
|
||||
|
||||
20000502-14:25 GMT+1 Ryszard Glab <rglab@imid.med.pl>
|
||||
|
||||
*source/compiler/harbour.c
|
||||
|
||||
@@ -2390,21 +2390,27 @@ static void hb_vmArrayPush( void )
|
||||
{
|
||||
if( ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
|
||||
{
|
||||
hb_arrayGet( pArray, ulIndex, pArray );
|
||||
hb_stackPop();
|
||||
if( pArray->item.asArray.value->uiHolders > 1 )
|
||||
{
|
||||
/* this is a temporary copy of an array - we can overwrite
|
||||
* it with no problem
|
||||
*/
|
||||
hb_arrayGet( pArray, ulIndex, pArray );
|
||||
hb_stackPop();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* this is a constant array { 1, 2, 3 } - we cannot use
|
||||
* the optimization here
|
||||
*/
|
||||
HB_ITEM item;
|
||||
|
||||
/* Looks like this without optimization:
|
||||
hb_arrayGet( pArray, ulIndex, &item );
|
||||
hb_stackPop();
|
||||
|
||||
HB_ITEM item;
|
||||
|
||||
hb_arrayGet( pArray, ulIndex, &item );
|
||||
hb_stackPop();
|
||||
hb_stackPop();
|
||||
|
||||
hb_itemCopy( hb_stack.pPos, &item );
|
||||
hb_itemClear( &item );
|
||||
hb_stackPush();
|
||||
*/
|
||||
hb_itemCopy( hb_stack.pPos - 1, &item );
|
||||
hb_itemClear( &item );
|
||||
}
|
||||
}
|
||||
else
|
||||
hb_errRT_BASE( EG_BOUND, 1132, NULL, hb_langDGetErrorDesc( EG_ARRACCESS ) );
|
||||
|
||||
Reference in New Issue
Block a user