aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2014-12-11 07:22:35 +0800
committerLefteris Karapetsas <lefteris@refu.co>2014-12-11 07:22:35 +0800
commit207da9ef0f8c67bc39393652d995b55cbfd0eb97 (patch)
tree26a94445d4964016a8b61afd379389ef52668c5a
parentd377ad3fb13dda6e8a629adfe7484359bda0706d (diff)
downloaddexon-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.cpp15
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
{