diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-10-21 09:25:15 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-10-21 10:18:33 +0200 |
commit | 7199f8c91fea3d3812b08539274eb3e73a7af69c (patch) | |
tree | 702e726388c2654e299866c0fe3033f058edf3c1 /basic | |
parent | 1baab81b8112f45a300d061ff1e3e6f3025d21bd (diff) |
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@collabora.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/comp/loops.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
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; |