Merge pull request #950 from yrabbit/start

gowin: don't crash if no arguments are set
This commit is contained in:
gatecat 2022-03-16 14:41:18 +00:00 committed by GitHub
commit c278a29a38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,6 +56,10 @@ po::options_description GowinCommandHandler::getArchOptions()
std::unique_ptr<Context> GowinCommandHandler::createContext(dict<std::string, Property> &values) std::unique_ptr<Context> GowinCommandHandler::createContext(dict<std::string, Property> &values)
{ {
if (!vm.count("device")) {
log_error("The device must be specified\n");
}
std::regex devicere = std::regex("GW1N([SZ]?)[A-Z]*-(LV|UV|UX)([0-9])(C?).*"); std::regex devicere = std::regex("GW1N([SZ]?)[A-Z]*-(LV|UV|UX)([0-9])(C?).*");
std::smatch match; std::smatch match;
std::string device = vm["device"].as<std::string>(); std::string device = vm["device"].as<std::string>();