diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a729b78ab3..587b4143ad 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,15 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2004-04-09 10:10 UTC+0100 Ryszard Glab + * include/hbexpra.c + * include/hbexprop.h + * source/compiler/expropta.c + * source/macro/macroa.c + * source/vm/macro.c + * fixed my previous fix to correctly release memory in + the macro compiler + 2004-04-08 17:20 UTC+0100 Ryszard Glab * include/hbexpra.c * source/compiler/expropta.c diff --git a/harbour/include/hbexpra.c b/harbour/include/hbexpra.c index bb1f989601..d3cab38df5 100644 --- a/harbour/include/hbexpra.c +++ b/harbour/include/hbexpra.c @@ -164,36 +164,29 @@ void hb_compExprClear( HB_EXPR_PTR pExpr ) #endif } -#if defined( HB_MACRO_SUPPORT ) -void hb_compExprKill( HB_EXPR_PTR pExpr, HB_MACRO_DECL ) -{ - HB_TRACE(HB_TR_DEBUG, ("hb_compExprKill()")); - if( pExpr->ExprType != HB_ET_NONE ) - { - HB_EXPR_PCODE1( hb_compExprDelete, pExpr ); - } -} -#endif - /* Delete all components and delete self */ #if defined( HB_MACRO_SUPPORT ) void hb_compExprDelete( HB_EXPR_PTR pExpr, HB_MACRO_DECL ) -#else -void hb_compExprDelete( HB_EXPR_PTR pExpr ) -#endif { HB_TRACE(HB_TR_DEBUG, ("hb_compExprDelete()")); -#if defined( HB_MACRO_SUPPORT ) - pExpr->ExprType = HB_ET_NONE; + if( pExpr->ExprType != HB_ET_NONE ) + { + HB_EXPR_USE( pExpr, HB_EA_DELETE ); + pExpr->ExprType = HB_ET_NONE; + } +} #else +void hb_compExprDelete( HB_EXPR_PTR pExpr ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_compExprDelete()")); if( --pExpr->Counter == 0 ) { HB_EXPR_USE( pExpr, HB_EA_DELETE ); HB_XFREE( pExpr ); } -#endif } +#endif /* Delete all components and delete self */ diff --git a/harbour/include/hbexprop.h b/harbour/include/hbexprop.h index dc77bf8cce..5801dc704f 100644 --- a/harbour/include/hbexprop.h +++ b/harbour/include/hbexprop.h @@ -389,7 +389,6 @@ BOOL hb_compExprIsValidMacro( char *, BOOL *, HB_MACRO_DECL ); #ifdef HB_MACRO_SUPPORT -void hb_compExprKill( HB_EXPR_PTR, HB_MACRO_DECL ); HB_EXPR_PTR hb_compExprNewArrayAt( HB_EXPR_PTR, HB_EXPR_PTR, HB_MACRO_DECL ); HB_EXPR_PTR hb_compExprSetOperand( HB_EXPR_PTR, HB_EXPR_PTR, HB_MACRO_DECL ); HB_EXPR_PTR hb_compExprGenPop( HB_EXPR_PTR, HB_MACRO_DECL ); diff --git a/harbour/source/compiler/expropta.c b/harbour/source/compiler/expropta.c index 4099972e7c..6e844c70bb 100644 --- a/harbour/source/compiler/expropta.c +++ b/harbour/source/compiler/expropta.c @@ -5,6 +5,6 @@ /* hbexpra.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) - * 1.12 - ignore this magic number - this is used to force compilation + * 1.13 - ignore this magic number - this is used to force compilation */ #include "hbexpra.c" diff --git a/harbour/source/macro/macroa.c b/harbour/source/macro/macroa.c index b73c888927..9a04034279 100644 --- a/harbour/source/macro/macroa.c +++ b/harbour/source/macro/macroa.c @@ -5,7 +5,7 @@ /* hbexpra.c is also included from ../compiler/expropta.c * However it produces a slighty different code if used in * macro compiler (there is an additional parameter passed to some functions) - * 1.12 - ignore this magic number - this is used to force compilation + * 1.13 - ignore this magic number - this is used to force compilation */ #define HB_MACRO_SUPPORT diff --git a/harbour/source/vm/macro.c b/harbour/source/vm/macro.c index 4d6c7fc327..6718a44b96 100644 --- a/harbour/source/vm/macro.c +++ b/harbour/source/vm/macro.c @@ -155,7 +155,7 @@ static int hb_macroParse( HB_MACRO_PTR pMacro, char * szString ) HB_MEXPR_PTR pMExpr = s_macroAlloc; do { - hb_compExprKill( &pMExpr->Expression, pMacro ); + hb_compExprDelete( &pMExpr->Expression, pMacro ); pMExpr = pMExpr->pPrev; } while( pMExpr );