From 5fd29fa2e6e23ac1380a75d76ced79bca8411b0a Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 27 Jul 2011 22:32:19 +0000 Subject: [PATCH] 2011-07-28 00:32 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/vm/hvm.c ! fixed infinite error retry loop when variable is create inside error handler --- harbour/ChangeLog | 5 +++++ harbour/src/vm/hvm.c | 35 ++++++++++++++++------------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6bf7dda613..eed10544b9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2011-07-28 00:32 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/vm/hvm.c + ! fixed infinite error retry loop when variable is create inside + error handler + 2011-07-28 00:08 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg ! -hbcc help description cleanup as suggested by Phil Krylov diff --git a/harbour/src/vm/hvm.c b/harbour/src/vm/hvm.c index 3d13a76d0a..952d9cd525 100644 --- a/harbour/src/vm/hvm.c +++ b/harbour/src/vm/hvm.c @@ -7143,35 +7143,32 @@ static void hb_vmPushStaticByRef( HB_USHORT uiStatic ) static void hb_vmPushVariable( PHB_SYMB pVarSymb ) { HB_STACK_TLS_PRELOAD - HB_USHORT uiAction = E_DEFAULT; PHB_ITEM pItem; HB_TRACE(HB_TR_INFO, ("(hb_vmPushVariable)")); pItem = hb_stackAllocItem(); - do + /* First try if passed symbol is a name of field + * in a current workarea - if it is not a field (HB_FAILURE) + * then try the memvar variable + */ + if( hb_rddFieldGet( pItem, pVarSymb ) != HB_SUCCESS && + hb_memvarGet( pItem, pVarSymb ) != HB_SUCCESS ) { - /* First try if passed symbol is a name of field - * in a current workarea - if it is not a field (HB_FAILURE) - * then try the memvar variable - */ - if( hb_rddFieldGet( pItem, pVarSymb ) != HB_SUCCESS ) + HB_ITEM_PTR pError = hb_errRT_New( ES_ERROR, NULL, EG_NOVAR, 1003, + NULL, pVarSymb->szName, + 0, EF_CANRETRY ); + + while( hb_errLaunch( pError ) == E_RETRY ) { - if( hb_memvarGet( pItem, pVarSymb ) != HB_SUCCESS ) - { - HB_ITEM_PTR pError; - - pError = hb_errRT_New( ES_ERROR, NULL, EG_NOVAR, 1003, - NULL, pVarSymb->szName, - 0, EF_CANRETRY ); - - uiAction = hb_errLaunch( pError ); - hb_errRelease( pError ); - } + if( hb_rddFieldGet( pItem, pVarSymb ) == HB_SUCCESS || + hb_memvarGet( pItem, pVarSymb ) == HB_SUCCESS ) + break; } + + hb_errRelease( pError ); } - while( uiAction == E_RETRY ); }