From 18cdcd232efffd93995edd768a494748b3c57a98 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Sun, 16 Sep 2007 18:45:18 +0000 Subject: [PATCH] 2007-09-16 22:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/compiler/hbopt.c ! fixed bad typo in last modification - thanks to Viktor * added additional line number validation to not make optimizations which will change line numbers --- harbour/ChangeLog | 6 ++++++ harbour/source/compiler/hbopt.c | 14 +++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index bd45682f98..370295ae0b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-09-16 22:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/compiler/hbopt.c + ! fixed bad typo in last modification - thanks to Viktor + * added additional line number validation to not make optimizations + which will change line numbers + 2007-09-16 20:14 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * source/rtl/tbrowse.prg ! C5.x compatible fix for non-numeric values inside the diff --git a/harbour/source/compiler/hbopt.c b/harbour/source/compiler/hbopt.c index 55a5e9601a..204d9b14e0 100644 --- a/harbour/source/compiler/hbopt.c +++ b/harbour/source/compiler/hbopt.c @@ -486,8 +486,9 @@ static HB_OPT_FUNC( hb_p_jumpfar ) case HB_P_JUMPFALSEFAR: ulNewPos += HB_PCODE_MKINT24( &pFunc->pCode[ ulNewPos + 1 ] ); - if( ulNewPos == lPCodePos + 4 && - ( !fLine || pFunc->pCode[ ulNewPos ] == HB_P_LINE ) ) + if( ulNewPos == lPCodePos + 4 && ( !fLine || + ( pFunc->pCode[ ulNewPos ] == HB_P_LINE && + pFunc->pCode[ lPCodePos + lOffset + 4 ] == HB_P_LINE ) ) ) { pFunc->pCode[ lPCodePos ] = HB_P_JUMPTRUEFAR; HB_PUT_LE_UINT24( pAddr, lOffset + 4 ); @@ -496,8 +497,9 @@ static HB_OPT_FUNC( hb_p_jumpfar ) case HB_P_JUMPTRUEFAR: ulNewPos += HB_PCODE_MKINT24( &pFunc->pCode[ ulNewPos + 1 ] ); - if( ulNewPos == lPCodePos + 4 && - ( !fLine || pFunc->pCode[ ulNewPos ] == HB_P_LINE ) ) + if( ulNewPos == lPCodePos + 4 && ( !fLine || + ( pFunc->pCode[ ulNewPos ] == HB_P_LINE && + pFunc->pCode[ lPCodePos + lOffset + 4 ] == HB_P_LINE ) ) ) { pFunc->pCode[ lPCodePos ] = HB_P_JUMPFALSEFAR; HB_PUT_LE_UINT24( pAddr, lOffset + 4 ); @@ -524,6 +526,7 @@ static HB_OPT_FUNC( hb_p_jumpfalsefar ) pFunc->pCode[ lPCodePos + 4 ] = HB_P_JUMPTRUEFAR; } else if( lOffset == 11 && pFunc->pCode[ lPCodePos + 4 ] == HB_P_LINE && + pFunc->pCode[ lPCodePos + 11 ] == HB_P_LINE && pFunc->pCode[ lPCodePos + 7 ] == HB_P_JUMPFAR && pFunc->pCode[ lPCodePos + 7 + HB_PCODE_MKINT24( &pFunc->pCode[ lPCodePos + 8 ] ) ] == HB_P_LINE && @@ -531,7 +534,7 @@ static HB_OPT_FUNC( hb_p_jumpfalsefar ) ! hb_compIsJump( cargo->HB_COMP_PARAM, pFunc, lPCodePos + 7 ) ) { hb_compNOOPfill( pFunc, lPCodePos, 7, FALSE, FALSE ); - pFunc->pCode[ lPCodePos + 7 ] = HB_P_JUMPFALSEFAR; + pFunc->pCode[ lPCodePos + 7 ] = HB_P_JUMPTRUEFAR; } else { @@ -567,6 +570,7 @@ static HB_OPT_FUNC( hb_p_jumptruefar ) pFunc->pCode[ lPCodePos + 4 ] = HB_P_JUMPFALSEFAR; } else if( lOffset == 11 && pFunc->pCode[ lPCodePos + 4 ] == HB_P_LINE && + pFunc->pCode[ lPCodePos + 11 ] == HB_P_LINE && pFunc->pCode[ lPCodePos + 7 ] == HB_P_JUMPFAR && pFunc->pCode[ lPCodePos + 7 + HB_PCODE_MKINT24( &pFunc->pCode[ lPCodePos + 8 ] ) ] == HB_P_LINE &&