diff options
Diffstat (limited to 'basic/source/comp/loops.cxx')
-rw-r--r-- | basic/source/comp/loops.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx index 07aac44943a6..1d7f9ff84dfd 100644 --- a/basic/source/comp/loops.cxx +++ b/basic/source/comp/loops.cxx @@ -210,6 +210,11 @@ void SbiParser::For() if( bForEach ) Next(); SbiExpression aLvalue( this, SbOPERAND ); + if (!aLvalue.IsVariable()) + { + bAbort = true; + return; // the error is already set in SbiExpression ctor + } aLvalue.Gen(); // variable on the Stack if( bForEach ) @@ -294,7 +299,7 @@ void SbiParser::BadBlock() if( eEndTok ) Error( ERRCODE_BASIC_BAD_BLOCK, eEndTok ); else - Error( ERRCODE_BASIC_BAD_BLOCK, "Loop/Next/Wend" ); + Error( ERRCODE_BASIC_BAD_BLOCK, u"Loop/Next/Wend"_ustr ); } // On expr Goto/Gosub n,n,n... @@ -307,7 +312,7 @@ void SbiParser::OnGoto() SbiToken eTok = Next(); if( eTok != GOTO && eTok != GOSUB ) { - Error( ERRCODE_BASIC_EXPECTED, "GoTo/GoSub" ); + Error( ERRCODE_BASIC_EXPECTED, u"GoTo/GoSub"_ustr ); eTok = GOTO; } @@ -528,7 +533,7 @@ void SbiParser::On() TestToken( NEXT ); aGen.Gen( SbiOpcode::NOERROR_ ); } - else Error( ERRCODE_BASIC_EXPECTED, "GoTo/Resume" ); + else Error( ERRCODE_BASIC_EXPECTED, u"GoTo/Resume"_ustr ); } } |