From efb9abf69c18247c61a9a4a7b5c0280d537e99fc Mon Sep 17 00:00:00 2001 From: Ron Pinkas Date: Fri, 25 May 2001 19:18:50 +0000 Subject: [PATCH] 2001-05-25 12:20 UTC-0800 Ron Pinkas * contrib/dot/pp.prg * Few corrections to NextToken() and CompileRule() to match Clipper behaviour regrding decimal point, and decimal numbers. * source/pp/ppcore.c - Removed unused variable as per compiler warning. * source/vm/hvm.c ! Fixed HB_P_POPFIELD and HB_P_POPVARIABLE to NOT pop top stack element pre-maturely. Item is now pop only after assignment took place. This fixes problem where the FieldPut rutine had to use the stack, thus overriding the assigned item. --- harbour/ChangeLog | 12 ++++++++++++ harbour/source/pp/ppcore.c | 2 -- harbour/source/vm/hvm.c | 6 +++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0db8a5acd9..d2d8882cc2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,15 @@ +2001-05-25 12:20 UTC-0800 Ron Pinkas + * contrib/dot/pp.prg + * Few corrections to NextToken() and CompileRule() to match Clipper behaviour regrding decimal point, and decimal numbers. + + * source/pp/ppcore.c + - Removed unused variable as per compiler warning. + + * source/vm/hvm.c + ! Fixed HB_P_POPFIELD and HB_P_POPVARIABLE to NOT pop top stack element pre-maturely. + Item is now pop only after assignment took place. This fixes problem where the FieldPut rutine had to use the stack, + thus overriding the assigned item. + 2001-05-24 01:09 UTC-0800 Brian Hays * source/rdd/dbcmd.c diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index b14a193440..3edb6f2e55 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -1030,8 +1030,6 @@ int hb_pp_ParseExpression( char * sLine, char * sOutLine ) if( *ptri == '#' ) { - char *pTmp = sLine; - hb_pp_ParseDirective( ptri+1 ); if( ipos > 0 ) diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index b52f004d52..4ba9329d39 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -1138,8 +1138,8 @@ void hb_vmExecute( const BYTE * pCode, PHB_SYMB pSymbols ) /* Pops a value from the eval stack and uses it to set * a new value of the given field */ + hb_rddPutFieldValue( ( hb_stackItemFromTop(-1) ), pSymbols + ( USHORT ) ( pCode[ w + 1 ] + ( pCode[ w + 2 ] * 256 ) ) ); hb_stackDec(); - hb_rddPutFieldValue( ( hb_stackTopItem() ), pSymbols + ( USHORT ) ( pCode[ w + 1 ] + ( pCode[ w + 2 ] * 256 ) ) ); hb_itemClear( ( hb_stackTopItem() ) ); HB_TRACE(HB_TR_INFO, ("(hb_vmPopField)")); w += 3; @@ -1181,9 +1181,9 @@ void hb_vmExecute( const BYTE * pCode, PHB_SYMB pSymbols ) * then try the memvar variable (it will create PRIVATE * variable if this variable doesn't exist) */ + if( hb_rddFieldPut( ( hb_stackItemFromTop(-1) ), pSymbols + uiParams ) == FAILURE ) + hb_memvarSetValue( pSymbols + uiParams, ( hb_stackItemFromTop(-1) ) ); hb_stackDec(); - if( hb_rddFieldPut( ( hb_stackTopItem() ), pSymbols + uiParams ) == FAILURE ) - hb_memvarSetValue( pSymbols + uiParams, ( hb_stackTopItem() ) ); hb_itemClear( ( hb_stackTopItem() ) ); HB_TRACE(HB_TR_INFO, ("(hb_vmPopVariable)")); w += 3;