coverity#736759 Dereference before null check

Change-Id: Ia36e192d32c46a5c1129eca050b2863ec1213bb4
This commit is contained in:
Caolán McNamara 2014-06-04 11:19:51 +01:00
parent 9e2ca10d8a
commit 332a67afdc

View File

@ -413,11 +413,12 @@ void ONthOperator::Exec(OCodeStack& rCodeStack)
OSL_ENSURE(!rCodeStack.empty(),"Stack must be none empty!"); OSL_ENSURE(!rCodeStack.empty(),"Stack must be none empty!");
pOperand = rCodeStack.top(); pOperand = rCodeStack.top();
rCodeStack.pop(); rCodeStack.pop();
if ( !IS_TYPE(OStopOperand,pOperand) ) assert(pOperand);
if (pOperand && !IS_TYPE(OStopOperand,pOperand))
aValues.push_back( pOperand->getValue() ); aValues.push_back( pOperand->getValue() );
aOperands.push_back( pOperand ); aOperands.push_back( pOperand );
} }
while ( !IS_TYPE(OStopOperand,pOperand) ); while (pOperand && !IS_TYPE(OStopOperand,pOperand));
rCodeStack.push(new OOperandResult(operate(aValues))); rCodeStack.push(new OOperandResult(operate(aValues)));