diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2014-12-11 07:22:35 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2014-12-11 07:22:35 +0800 |
commit | 207da9ef0f8c67bc39393652d995b55cbfd0eb97 (patch) | |
tree | 26a94445d4964016a8b61afd379389ef52668c5a | |
parent | d377ad3fb13dda6e8a629adfe7484359bda0706d (diff) | |
download | dexon-solidity-207da9ef0f8c67bc39393652d995b55cbfd0eb97.tar dexon-solidity-207da9ef0f8c67bc39393652d995b55cbfd0eb97.tar.gz dexon-solidity-207da9ef0f8c67bc39393652d995b55cbfd0eb97.tar.bz2 dexon-solidity-207da9ef0f8c67bc39393652d995b55cbfd0eb97.tar.lz dexon-solidity-207da9ef0f8c67bc39393652d995b55cbfd0eb97.tar.xz dexon-solidity-207da9ef0f8c67bc39393652d995b55cbfd0eb97.tar.zst dexon-solidity-207da9ef0f8c67bc39393652d995b55cbfd0eb97.zip |
Fixing segfault for solc if stdin is given as input file
- Solc should now check its input files and skip them if they don't
exist or if they are not a valid file
-rw-r--r-- | CommandLineInterface.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/CommandLineInterface.cpp b/CommandLineInterface.cpp index d3dd3945..6ace332f 100644 --- a/CommandLineInterface.cpp +++ b/CommandLineInterface.cpp @@ -255,7 +255,22 @@ bool CommandLineInterface::processInput() } else for (string const& infile: m_args["input-file"].as<vector<string>>()) + { + auto path = boost::filesystem::path(infile); + if (!boost::filesystem::exists(path)) + { + cout << "Skipping non existant input file \"" << infile << "\"" << endl; + continue; + } + + if (!boost::filesystem::is_regular_file(path)) + { + cout << "\"" << infile << "\" is not a valid file. Skipping" << endl; + continue; + } + m_sourceCodes[infile] = asString(dev::contents(infile)); + } try { |