Fix crash for input from stdin.

This commit is contained in:
chriseth 2016-06-15 01:35:36 +02:00
parent 5f97274a6c
commit 781b7eaefe

View File

@ -564,7 +564,8 @@ bool CommandLineInterface::processInput()
auto scannerFromSourceName = [&](string const& _sourceName) -> solidity::Scanner const& { return m_compiler->scanner(_sourceName); };
try
{
m_compiler->setRemappings(m_args["input-file"].as<vector<string>>());
if (m_args.count("input-file"))
m_compiler->setRemappings(m_args["input-file"].as<vector<string>>());
for (auto const& sourceCode: m_sourceCodes)
m_compiler->addSource(sourceCode.first, sourceCode.second);
// TODO: Perhaps we should not compile unless requested