diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6d028e92c0..9d63d1b5ef 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-01-08 13:12 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) + * harbour/source/compiler/hbopt.c + * improved 'variable assigned but unused' detection logic + * harbour/source/rtl/treport.prg + * fixed assigned but unused variable + 2009-01-07 13:56 UTC-0600 Teo Fonrouge (teo/at/windtelsoft/dot/com) * source/vm/classes.c + addded __objHasMsgAssigned( object, "msgName" ) diff --git a/harbour/source/compiler/hbopt.c b/harbour/source/compiler/hbopt.c index fd725d1e81..5a43673e48 100644 --- a/harbour/source/compiler/hbopt.c +++ b/harbour/source/compiler/hbopt.c @@ -1255,17 +1255,20 @@ static int hb_compPCodeTraceAssignedUnused( PFUNCTION pFunc, ULONG ulPos, BYTE * pFunc->pCode[ ulPos ] == HB_P_PUSHLOCAL || pFunc->pCode[ ulPos ] == HB_P_PUSHLOCALNEAR || pFunc->pCode[ ulPos ] == HB_P_PUSHLOCALREF || - pFunc->pCode[ ulPos ] == HB_P_LOCALINCPUSH ) + pFunc->pCode[ ulPos ] == HB_P_LOCALINCPUSH || + pFunc->pCode[ ulPos ] == HB_P_LOCALDEC || + pFunc->pCode[ ulPos ] == HB_P_LOCALINC || + pFunc->pCode[ ulPos ] == HB_P_LOCALADDINT || + pFunc->pCode[ ulPos ] == HB_P_LOCALNEARADDINT ) + { if( hb_compLocalGetNumber( pFunc->pCode + ulPos ) == isLocal ) { - if( pFunc->pCode[ ulPos ] == HB_P_PUSHLOCAL || - pFunc->pCode[ ulPos ] == HB_P_PUSHLOCALNEAR || - pFunc->pCode[ ulPos ] == HB_P_PUSHLOCALREF || - pFunc->pCode[ ulPos ] == HB_P_LOCALINCPUSH ) - return 1; - else + if( pFunc->pCode[ ulPos ] == HB_P_POPLOCAL || + pFunc->pCode[ ulPos ] == HB_P_POPLOCALNEAR ) return 0; + else + return 1; } } @@ -1330,6 +1333,14 @@ static void hb_compPCodeEnumAssignedUnused( HB_COMP_DECL, PFUNCTION pFunc, PHB_O pFunc->pCode[ ulPos ] == HB_P_POPLOCALNEAR ) && ! ( ulPos > 0 && pFunc->pCode[ ulLastPos ] == HB_P_PUSHNIL ); + if( !fCheck && ( pFunc->pCode[ ulPos ] == HB_P_LOCALDEC || + pFunc->pCode[ ulPos ] == HB_P_LOCALINC || + pFunc->pCode[ ulPos ] == HB_P_LOCALADDINT || + pFunc->pCode[ ulPos ] == HB_P_LOCALNEARADDINT ) ) + { + fCheck = TRUE; + } + if( !fCheck && pFunc->pCode[ ulPos ] == HB_P_PUSHLOCALREF ) { ULONG ulPosNext = ulPos + hb_compPCodeSize( pFunc, ulPos ); diff --git a/harbour/source/rtl/treport.prg b/harbour/source/rtl/treport.prg index 065dc60ddb..070ba20000 100644 --- a/harbour/source/rtl/treport.prg +++ b/harbour/source/rtl/treport.prg @@ -1040,7 +1040,7 @@ METHOD LoadReportFile( cFrmFile ) CLASS HBReportForm IF Int( cOptionByte / 1 ) == 1 aReport[ RPT_BEJECT ] := .F. // Page eject before report - cOptionByte -= 1 + //cOptionByte -= 1 ENDIF // Page heading, report title