Commit 34a8a57d authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

fix crash when no command line options are passed to qmake

the root cause is in the API of parsedProFile(): it discerns
isNull() and isEmpty(), which is of course a time bomb.
but in this case the right solution is not trying to parse
the empty string in the first place.
parent ee8ea6df
...@@ -1273,6 +1273,7 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProFile( ...@@ -1273,6 +1273,7 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProFile(
if (tgt.isEmpty()) if (tgt.isEmpty())
tgt.append(ProString(QFileInfo(pro->fileName()).baseName(), NoHash)); tgt.append(ProString(QFileInfo(pro->fileName()).baseName(), NoHash));
if (!m_cmdArgs.isEmpty()) {
if (ProFile *pro = m_parser->parsedProFile( if (ProFile *pro = m_parser->parsedProFile(
fL1S("(command line)"), false, m_cmdArgs.join(fL1S("\n")))) { fL1S("(command line)"), false, m_cmdArgs.join(fL1S("\n")))) {
m_locationStack.push(m_current); m_locationStack.push(m_current);
...@@ -1281,6 +1282,7 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProFile( ...@@ -1281,6 +1282,7 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProFile(
pro->deref(); pro->deref();
} }
} }
}
visitProBlock(pro, pro->tokPtr()); visitProBlock(pro, pro->tokPtr());
......
Supports Markdown
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