diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 50127bee48..098ce24406 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,26 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2003-10-23 11:00 UTC+0100 Ryszard Glab + * include/hbexprc.c + * source/compiler/exproptc.c + * a variable pbUseTextSubst is initialized correctly when + compiled with macro support + + * source/compiler/harbour.l + * (char *) cast was added + + * source/vm/itemapi.c + * check for a loop in variable de-referencing was added + The following code: + var := IIF( .T., @var, var ) + is causing that the variable is referencing itself + (valid syntax in Clipper) + + * source/vm/macro.c + * fixed to link correctly with WATCOM linker + + 2003-10-23 10:30 UTC+0300 Alexander Kresin * source/rtl/strcase.c ! hb_strncpyUpper() and hb_strncpyUpperTrim() fixed. diff --git a/harbour/include/hbexprc.c b/harbour/include/hbexprc.c index 3ee4d476ad..d2caef2709 100644 --- a/harbour/include/hbexprc.c +++ b/harbour/include/hbexprc.c @@ -442,6 +442,7 @@ BOOL hb_compExprIsValidMacro( char * szText, BOOL *pbUseTextSubst ) { #if defined( HB_MACRO_SUPPORT ) HB_SYMBOL_UNUSED( bMacroText ); + *pbUseTextSubst = TRUE; /* valid macro expression */ return TRUE; /*there is no need to check all '&' occurences */ #else /* There is a valid character after '&' that can be used in diff --git a/harbour/source/compiler/exproptc.c b/harbour/source/compiler/exproptc.c index cb7afb7036..1bf1a188ce 100644 --- a/harbour/source/compiler/exproptc.c +++ b/harbour/source/compiler/exproptc.c @@ -5,6 +5,6 @@ /* hbexprc.c is also included from ../macro/macro.c * However it produces a slighty different code if used in * macro compiler (there is an additional parameter passed to some functions) - * 4 - ignore this magic number - this is used to force compilation + * 5 - ignore this magic number - this is used to force compilation */ #include "hbexprc.c" diff --git a/harbour/source/compiler/harbour.l b/harbour/source/compiler/harbour.l index a34b390dda..e88b850571 100644 --- a/harbour/source/compiler/harbour.l +++ b/harbour/source/compiler/harbour.l @@ -1506,7 +1506,7 @@ Separator {SpaceTab} cText++; } cMark = yytext[ iLen ]; - yylval.asCodeblock.string = hb_xgrab( iLen+1 ); + yylval.asCodeblock.string = (char *)hb_xgrab( iLen+1 ); memcpy( (void *)yylval.asCodeblock.string, (void *)yytext, iLen ); yylval.asCodeblock.string[iLen] = '\0'; yylval.asCodeblock.length = iLen; diff --git a/harbour/source/vm/itemapi.c b/harbour/source/vm/itemapi.c index 3de677cc92..f853848deb 100644 --- a/harbour/source/vm/itemapi.c +++ b/harbour/source/vm/itemapi.c @@ -970,10 +970,14 @@ void hb_itemSwap( PHB_ITEM pItem1, PHB_ITEM pItem2 ) PHB_ITEM hb_itemUnRef( PHB_ITEM pItem ) { + PHB_ITEM pRef = pItem; + HB_TRACE(HB_TR_DEBUG, ("hb_itemUnRef(%p)", pItem)); - while( HB_IS_BYREF( pItem ) ) + do { pItem = hb_itemUnRefOnce( pItem ); + } + while( HB_IS_BYREF( pItem ) && (pRef != pItem) ); return pItem; } diff --git a/harbour/source/vm/macro.c b/harbour/source/vm/macro.c index cecd81f899..878e7f4058 100644 --- a/harbour/source/vm/macro.c +++ b/harbour/source/vm/macro.c @@ -442,8 +442,6 @@ char * hb_macroTextSubst( char * szString, ULONG *pulStringLen ) * EVAL( {|| ¯o} ) * */ -void hb_macroGetValue( HB_ITEM_PTR pItem, BYTE iContext, BYTE flags ) -{ /* TODO: remove these externals */ extern int hb_vm_aiExtraParams[HB_MAX_MACRO_ARGS], hb_vm_iExtraParamsIndex; extern int hb_vm_aiExtraElements[HB_MAX_MACRO_ARGS], hb_vm_iExtraElementsIndex; @@ -451,6 +449,8 @@ void hb_macroGetValue( HB_ITEM_PTR pItem, BYTE iContext, BYTE flags ) extern PHB_SYMB hb_vm_apExtraParamsSymbol[HB_MAX_MACRO_ARGS]; +void hb_macroGetValue( HB_ITEM_PTR pItem, BYTE iContext, BYTE flags ) +{ HB_TRACE(HB_TR_DEBUG, ("hb_macroGetValue(%p)", pItem)); if( hb_macroCheckParam( pItem ) )