diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 2365d3aeb112..fe6263a39f90 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -226,6 +226,8 @@ bool SbiScanner::NextSym() nOldCol1 = nOldCol2 = 0; } + const sal_Int32 nLineIdxScanStart = nLineIdx; + if(nCol < aLine.getLength() && BasicCharClass::isWhitespace(aLine[nCol])) { bSpaces = true; @@ -632,6 +634,13 @@ PrevLineCommentLbl: nCol2 = nCol2 + nLen; nLineIdx = -1; } + + if (nLineIdx == nLineIdxScanStart) + { + GenError( ERRCODE_BASIC_SYMBOL_EXPECTED ); + return false; + } + return true;