summaryrefslogtreecommitdiff
path: root/basic/source/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/runtime')
-rw-r--r--basic/source/runtime/methods1.cxx7
-rw-r--r--basic/source/runtime/runtime.cxx42
-rw-r--r--basic/source/runtime/step2.cxx10
3 files changed, 43 insertions, 16 deletions
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 2c9c22f7f44a..dbd66a61575c 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -662,12 +662,15 @@ RTLFUNC(Array)
}
// Parameter ins Array uebernehmen
- for( short i = 0 ; i < nArraySize ; i++ )
+ // ATTENTION: Using type USHORT for loop variable is
+ // mandatory to workaround a problem with the
+ // Solaris Intel compiler optimizer! See i104354
+ for( USHORT i = 0 ; i < nArraySize ; i++ )
{
SbxVariable* pVar = rPar.Get(i+1);
SbxVariable* pNew = new SbxVariable( *pVar );
pNew->SetFlag( SBX_WRITE );
- short index = i;
+ short index = static_cast< short >(i);
if ( bIncIndex )
++index;
pArray->Put( pNew, &index );
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index d81cebe60fc6..cc276eea766b 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -430,6 +430,11 @@ void SbiInstance::FatalError( SbError n )
pRun->FatalError( n );
}
+void SbiInstance::FatalError( SbError _errCode, const String& _details )
+{
+ pRun->FatalError( _errCode, _details );
+}
+
void SbiInstance::Abort()
{
// Basic suchen, in dem der Fehler auftrat
@@ -721,7 +726,7 @@ BOOL SbiRuntime::Step()
pCode = pError;
else
bLetParentHandleThis = true;
- }
+ }
else
{
bLetParentHandleThis = true;
@@ -795,12 +800,35 @@ void SbiRuntime::Error( SbError n )
nError = n;
}
+void SbiRuntime::Error( SbError _errCode, const String& _details )
+{
+ if ( _errCode )
+ {
+ OSL_ENSURE( pInst->pRun == this, "SbiRuntime::Error: can't propagate the error message details!" );
+ if ( pInst->pRun == this )
+ {
+ pInst->Error( _errCode, _details );
+ OSL_POSTCOND( nError == _errCode, "SbiRuntime::Error: the instance is expecte to propagate the error code back to me!" );
+ }
+ else
+ {
+ nError = _errCode;
+ }
+ }
+}
+
void SbiRuntime::FatalError( SbError n )
{
StepSTDERROR();
Error( n );
}
+void SbiRuntime::FatalError( SbError _errCode, const String& _details )
+{
+ StepSTDERROR();
+ Error( _errCode, _details );
+}
+
//////////////////////////////////////////////////////////////////////////
//
// Parameter, Locals, Caller
@@ -859,21 +887,13 @@ SbxVariableRef SbiRuntime::PopVar()
BOOL SbiRuntime::ClearExprStack()
{
- // #74732 Hier kann ein Fehler gesetzt werden
- BOOL bErrorSet = FALSE;
-
// Achtung: Clear() reicht nicht, da Methods geloescht werden muessen
while ( nExprLvl )
{
- SbxVariableRef xVar = PopVar();
- if( !nError && xVar->ISA( UnoClassMemberVariable ) )
- {
- Error( SbERR_NO_METHOD );
- bErrorSet = TRUE;
- }
+ PopVar();
}
refExprStk->Clear();
- return bErrorSet;
+ return FALSE;
}
// Variable auf dem Expression-Stack holen, ohne sie zu entfernen
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index 2a7c69b16323..413d3a6f4def 100644
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -199,7 +199,7 @@ SbxVariable* SbiRuntime::FindElement
}
// #72382 VORSICHT! Liefert jetzt wegen unbekannten
// Modulen IMMER ein Ergebnis!
- SbxVariable* pUnoClass = findUnoClass( aName );
+ SbUnoClass* pUnoClass = findUnoClass( aName );
if( pUnoClass )
{
pElem = new SbxVariable( t );
@@ -255,7 +255,7 @@ SbxVariable* SbiRuntime::FindElement
ClearArgvStack();
// Normalen Error setzen
- Error( nNotFound );
+ Error( nNotFound, aName );
}
else
{
@@ -832,6 +832,7 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 )
// Wenn der Expr-Stack am Anfang einen Statements eine Variable enthaelt,
// hat ein Trottel X als Funktion aufgerufen, obwohl es eine Variable ist!
BOOL bFatalExpr = FALSE;
+ String sUnknownMethodName;
if( nExprLvl > 1 )
bFatalExpr = TRUE;
else if( nExprLvl )
@@ -839,7 +840,10 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 )
SbxVariable* p = refExprStk->Get( 0 );
if( p->GetRefCount() > 1
&& refLocals.Is() && refLocals->Find( p->GetName(), p->GetClass() ) )
+ {
+ sUnknownMethodName = p->GetName();
bFatalExpr = TRUE;
+ }
}
// Der Expr-Stack ist nun nicht mehr notwendig
ClearExprStack();
@@ -854,7 +858,7 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 )
// stimmen!
if( bFatalExpr)
{
- StarBASIC::FatalError( SbERR_NO_METHOD );
+ StarBASIC::FatalError( SbERR_NO_METHOD, sUnknownMethodName );
return;
}
pStmnt = pCode - 9;