[Libreoffice-commits] core.git: basic/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 21 08:19:43 UTC 2019


 basic/source/comp/loops.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 7199f8c91fea3d3812b08539274eb3e73a7af69c
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Oct 21 09:25:15 2019 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Oct 21 10:18:33 2019 +0200

    tdf#128263: update push positions in single line IF
    
    The positions (including current line) might have changed in Next(),
    even though it's "single line IF", due to line continuation char _.
    nP* members haven't been updated yet, so next call to Next() after
    Push() would restore wrong positions.
    
    I didn't store values of nLine/nCol1/nCol2 before if( IsEoln( Next() ) ),
    (doing which would allow to mimic Peek() behaviour), because I don't
    see how restoring their old values in the single line IF case would
    affect the logic. Possibly something to do later.
    
    Change-Id: I5a2a5c307ccbba77e9c02db50a04e33d71cd15a8
    Reviewed-on: https://gerrit.libreoffice.org/81204
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx
index 40ac10bad9fc..daf7182fc3db 100644
--- a/basic/source/comp/loops.cxx
+++ b/basic/source/comp/loops.cxx
@@ -107,6 +107,11 @@ void SbiParser::If()
         bSingleLineIf = true;
         nEndLbl = aGen.Gen( SbiOpcode::JUMPF_, 0 );
         Push( eCurTok );
+        // tdf#128263: update push positions to correctly restore in Next()
+        nPLine = nLine;
+        nPCol1 = nCol1;
+        nPCol2 = nCol2;
+
         while( !bAbort )
         {
             if( !Parse() ) break;


More information about the Libreoffice-commits mailing list