Add check for BLIF with no model name

This commit is contained in:
Archie 2022-06-14 14:17:00 +01:00 committed by Lofty
parent 1fdbb42fdd
commit 7eeb656e2a
1 changed files with 4 additions and 1 deletions

View File

@ -166,7 +166,10 @@ void parse_blif(RTLIL::Design *design, std::istream &f, IdString dff_name, bool
goto error;
module = new RTLIL::Module;
lastcell = nullptr;
module->name = RTLIL::escape_id(strtok(NULL, " \t\r\n"));
char *name = strtok(NULL, " \t\r\n");
if (name == nullptr)
goto error;
module->name = RTLIL::escape_id(name);
obj_attributes = &module->attributes;
obj_parameters = nullptr;
if (design->module(module->name))