summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-10 11:37:50 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2020-07-14 21:53:55 +0200
commit1ecda3adc91328bc616b96367d90907350f2500f (patch)
tree4303bc87bb4862baf83a3d772695191fd0c331f1 /basic
parentad6d723bb6e37e70702ea467072a1dc077293839 (diff)
tdf#134576 at least don't crash in this edge-case
Change-Id: I69638fd2130c1ba68915906ced62bda2cd883932 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98491 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit b55f56ca0417105f1e10131503d5560fb6c7e452) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98757 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/runtime.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 0b603228fca9..71edbd1270ae 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -2600,10 +2600,14 @@ void SbiRuntime::StepNEXT()
StarBASIC::FatalError( ERRCODE_BASIC_INTERNAL_ERROR );
return;
}
- if( pForStk->eForType == ForType::To )
+ if (pForStk->eForType != ForType::To)
+ return;
+ if (!pForStk->refVar)
{
- pForStk->refVar->Compute( SbxPLUS, *pForStk->refInc );
+ StarBASIC::FatalError( ERRCODE_BASIC_INTERNAL_ERROR );
+ return;
}
+ pForStk->refVar->Compute( SbxPLUS, *pForStk->refInc );
}
// beginning CASE: TOS in CASE-stack