diff options
author | Archie <ac11018@ic.ac.uk> | 2022-06-14 14:17:00 +0100 |
---|---|---|
committer | Archie <ac11018@ic.ac.uk> | 2022-06-14 14:17:00 +0100 |
commit | b604c97b33de1785a10b2df2b3eaa48f2bee0719 (patch) | |
tree | 047149c60641029d090ceaca81ca49538f89b14f | |
parent | 3046a06490831b171a04b000f3676c5df0af68d5 (diff) | |
download | yosys-b604c97b33de1785a10b2df2b3eaa48f2bee0719.tar.gz yosys-b604c97b33de1785a10b2df2b3eaa48f2bee0719.tar.bz2 yosys-b604c97b33de1785a10b2df2b3eaa48f2bee0719.zip |
Add check for BLIF with no model name
-rw-r--r-- | frontends/blif/blifparse.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/frontends/blif/blifparse.cc b/frontends/blif/blifparse.cc index 19844bda6..73d1f0ea7 100644 --- a/frontends/blif/blifparse.cc +++ b/frontends/blif/blifparse.cc @@ -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)) |