fix unhandled std::out_of_range when calling yosys with 3-character argument
authorwhentze <muvlon@hentzes.de>
Mon, 22 Oct 2018 17:40:22 +0000 (19:40 +0200)
committerwhentze <muvlon@hentzes.de>
Mon, 22 Oct 2018 17:40:22 +0000 (19:40 +0200)
kernel/yosys.cc

index ad032899c1df30826cbba3c9adca7af0ebc1701e..21eeadaaf0f09b4ca9895fb84dd6ed338f60b53a 100644 (file)
@@ -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";