Commit 5438cd40 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Prevent a prossible crash in a wrong STRING() call

Treat some arguments as strings instead of expecting a correct input,
this will prevent a crash in case the input was wrong.

BUG: 309111
parent 6987de41
......@@ -1878,13 +1878,13 @@ int CMakeProjectVisitor::visit(const StringAst *sast)
kDebug(9032) << "warning! String configure is not supported!" << sast->content()[sast->line()].writeBack();
break;
case StringAst::ToUpper:
m_vars->insert(sast->outputVariable(), QStringList(sast->input()[0].toUpper()));
m_vars->insert(sast->outputVariable(), QStringList(sast->input().join(QChar(';')).toUpper()));
break;
case StringAst::ToLower:
m_vars->insert(sast->outputVariable(), QStringList(sast->input()[0].toLower()));
m_vars->insert(sast->outputVariable(), QStringList(sast->input().join(QChar(';')).toLower()));
break;
case StringAst::Length:
m_vars->insert(sast->outputVariable(), QStringList(QString::number(sast->input()[0].count())));
m_vars->insert(sast->outputVariable(), QStringList(QString::number(sast->input().join(QChar(';')).count())));
break;
case StringAst::Substring:
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment