mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-07 09:55:20 +00:00
Fix case when file does not exist
This commit is contained in:
parent
6538671c84
commit
3e4307c104
|
@ -456,6 +456,7 @@ void Frontend::extra_args(std::istream *&f, std::string &filename, std::vector<s
|
||||||
delete ff;
|
delete ff;
|
||||||
else
|
else
|
||||||
f = ff;
|
f = ff;
|
||||||
|
if (f != NULL) {
|
||||||
// Check for gzip magic
|
// Check for gzip magic
|
||||||
unsigned char magic[3];
|
unsigned char magic[3];
|
||||||
int n = readsome(*ff, reinterpret_cast<char*>(magic), 3);
|
int n = readsome(*ff, reinterpret_cast<char*>(magic), 3);
|
||||||
|
@ -477,6 +478,7 @@ void Frontend::extra_args(std::istream *&f, std::string &filename, std::vector<s
|
||||||
ff->seekg(0, std::ios::beg);
|
ff->seekg(0, std::ios::beg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
log_cmd_error("Can't open input file `%s' for reading: %s\n", filename.c_str(), strerror(errno));
|
log_cmd_error("Can't open input file `%s' for reading: %s\n", filename.c_str(), strerror(errno));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue