diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-10-25 13:23:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-25 13:23:26 +0200 |
commit | db676957a0c3032ff44e3195d770948c1c3660af (patch) | |
tree | da093aacf042a5c1bf42b6057b840df886d06121 | |
parent | 5ab58d49308a670178a404e6e11bd8758f33c16d (diff) | |
parent | 9ed77f5ba853a316cf88221fa142e188f84765f0 (diff) | |
download | yosys-db676957a0c3032ff44e3195d770948c1c3660af.tar.gz yosys-db676957a0c3032ff44e3195d770948c1c3660af.tar.bz2 yosys-db676957a0c3032ff44e3195d770948c1c3660af.zip |
Merge pull request #678 from whentze/master
Fix unhandled std::out_of_range in run_frontend() due to integer underflow
-rw-r--r-- | kernel/yosys.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/yosys.cc b/kernel/yosys.cc index ad032899c..21eeadaaf 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -821,7 +821,7 @@ void run_frontend(std::string filename, std::string command, std::string *backen command = "verilog"; else if (filename.size() > 2 && filename.substr(filename.size()-3) == ".sv") command = "verilog -sv"; - else if (filename.size() > 2 && filename.substr(filename.size()-4) == ".vhd") + else if (filename.size() > 3 && filename.substr(filename.size()-4) == ".vhd") command = "vhdl"; else if (filename.size() > 4 && filename.substr(filename.size()-5) == ".blif") command = "blif"; @@ -833,7 +833,7 @@ void run_frontend(std::string filename, std::string command, std::string *backen command = "ilang"; else if (filename.size() > 3 && filename.substr(filename.size()-3) == ".ys") command = "script"; - else if (filename.size() > 2 && filename.substr(filename.size()-4) == ".tcl") + else if (filename.size() > 3 && filename.substr(filename.size()-4) == ".tcl") command = "tcl"; else if (filename == "-") command = "script"; |