Check if stack is empty like in origin muparser.

--HG--
branch : develop
This commit is contained in:
dismine 2014-11-09 16:28:44 +02:00
parent 2cec69949d
commit e1ff009771

View File

@ -773,6 +773,10 @@ void QmuParserBase::ApplyFunc( QStack<token_type> &a_stOpt, QStack<token_type> &
QVector<token_type> stArg;
for (int i=0; i<iArgNumerical; ++i)
{
if (a_stVal.isEmpty())// Check if stack is empty like in origin muparser.
{
Error(ecUNASSIGNABLE_TOKEN, m_pTokenReader->GetPos(), funTok.GetAsString());
}
stArg.push_back( a_stVal.pop() );
if ( stArg.back().GetType()==tpSTR && funTok.GetType()!=tpSTR )
{