2007-04-03 13:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
    ! fixed false warning about unreachable code in
         switch ...; case ...; exit; case ...
      statement
    * disabled some error messages about illegal pass by reference
      now HVM should not allow to create cyclic reference chain
This commit is contained in:
Przemyslaw Czerpak
2007-04-03 11:01:58 +00:00
parent e884ecb4f0
commit 339996cfbe
3 changed files with 49 additions and 32 deletions

View File

@@ -8,6 +8,15 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-04-03 13:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/compiler/harbour.y
* harbour/source/compiler/harbour.yyc
! fixed false warning about unreachable code in
switch ...; case ...; exit; case ...
statement
* disabled some error messages about illegal pass by reference
now HVM should not allow to create cyclic reference chain
2007-04-02 19:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/ole/oleauto.prg
* removed unused local variable

View File

@@ -2379,7 +2379,9 @@ static void hb_compSwitchStart( HB_COMP_DECL )
static void hb_compSwitchAdd( HB_COMP_DECL, HB_EXPR_PTR pExpr )
{
HB_SWITCHCASE_PTR pCase;
HB_COMP_PARAM->functions.pLast->bFlags &= ~FUN_BREAK_CODE;
if( pExpr )
{
/* normal CASE */
@@ -2511,8 +2513,6 @@ void hb_compSwitchKill( HB_COMP_DECL )
static HB_EXPR_PTR hb_compCheckPassByRef( HB_COMP_DECL, HB_EXPR_PTR pExpr )
{
const char * szDesc;
if( pExpr->ExprType == HB_ET_FUNCALL )
{
if( hb_compExprParamListLen( pExpr->value.asFunCall.pParms ) == 0 )
@@ -2531,21 +2531,25 @@ static HB_EXPR_PTR hb_compCheckPassByRef( HB_COMP_DECL, HB_EXPR_PTR pExpr )
return pExpr;
}
}
else if( HB_COMP_PARAM->iPassByRef & ( HB_PASSBYREF_FUNCALL | HB_PASSBYREF_ARRAY ) )
return pExpr;
if( pExpr->ExprType == HB_ET_REFERENCE )
#if 0
else if( !( HB_COMP_PARAM->iPassByRef & ( HB_PASSBYREF_FUNCALL | HB_PASSBYREF_ARRAY ) ) )
{
HB_EXPR_PTR pDelExpr = pExpr;
pExpr = pExpr->value.asReference;
HB_COMP_EXPR_CLEAR( pDelExpr );
const char * szDesc;
if( pExpr->ExprType == HB_ET_REFERENCE )
{
HB_EXPR_PTR pDelExpr = pExpr;
pExpr = pExpr->value.asReference;
HB_COMP_EXPR_CLEAR( pDelExpr );
}
szDesc = hb_compExprAsSymbol( pExpr );
if( ! szDesc )
szDesc = hb_compExprDescription( pExpr );
return hb_compErrorRefer( HB_COMP_PARAM, pExpr, szDesc );
}
szDesc = hb_compExprAsSymbol( pExpr );
if( ! szDesc )
szDesc = hb_compExprDescription( pExpr );
return hb_compErrorRefer( HB_COMP_PARAM, pExpr, szDesc );
#endif
return pExpr;
}
/* ************************************************************************* */

View File

@@ -7615,7 +7615,9 @@ static void hb_compSwitchStart( HB_COMP_DECL )
static void hb_compSwitchAdd( HB_COMP_DECL, HB_EXPR_PTR pExpr )
{
HB_SWITCHCASE_PTR pCase;
HB_COMP_PARAM->functions.pLast->bFlags &= ~FUN_BREAK_CODE;
if( pExpr )
{
/* normal CASE */
@@ -7747,8 +7749,6 @@ void hb_compSwitchKill( HB_COMP_DECL )
static HB_EXPR_PTR hb_compCheckPassByRef( HB_COMP_DECL, HB_EXPR_PTR pExpr )
{
const char * szDesc;
if( pExpr->ExprType == HB_ET_FUNCALL )
{
if( hb_compExprParamListLen( pExpr->value.asFunCall.pParms ) == 0 )
@@ -7767,21 +7767,25 @@ static HB_EXPR_PTR hb_compCheckPassByRef( HB_COMP_DECL, HB_EXPR_PTR pExpr )
return pExpr;
}
}
else if( HB_COMP_PARAM->iPassByRef & ( HB_PASSBYREF_FUNCALL | HB_PASSBYREF_ARRAY ) )
return pExpr;
if( pExpr->ExprType == HB_ET_REFERENCE )
#if 0
else if( !( HB_COMP_PARAM->iPassByRef & ( HB_PASSBYREF_FUNCALL | HB_PASSBYREF_ARRAY ) ) )
{
HB_EXPR_PTR pDelExpr = pExpr;
pExpr = pExpr->value.asReference;
HB_COMP_EXPR_CLEAR( pDelExpr );
const char * szDesc;
if( pExpr->ExprType == HB_ET_REFERENCE )
{
HB_EXPR_PTR pDelExpr = pExpr;
pExpr = pExpr->value.asReference;
HB_COMP_EXPR_CLEAR( pDelExpr );
}
szDesc = hb_compExprAsSymbol( pExpr );
if( ! szDesc )
szDesc = hb_compExprDescription( pExpr );
return hb_compErrorRefer( HB_COMP_PARAM, pExpr, szDesc );
}
szDesc = hb_compExprAsSymbol( pExpr );
if( ! szDesc )
szDesc = hb_compExprDescription( pExpr );
return hb_compErrorRefer( HB_COMP_PARAM, pExpr, szDesc );
#endif
return pExpr;
}
/* ************************************************************************* */