diff options
author | Archie <ac11018@ic.ac.uk> | 2022-06-14 14:17:00 +0100 |
---|---|---|
committer | Lofty <dan.ravensloft@gmail.com> | 2022-06-22 00:34:49 +0100 |
commit | 7eeb656e2a8276f71c7b7ba7031618c5b7b0849a (patch) | |
tree | 448ddc4074cda2b8820e433c48ac83d43e6bc9f9 | |
parent | 1fdbb42fdd51aa940e4331cdf5b4d1ff56738658 (diff) | |
download | yosys-7eeb656e2a8276f71c7b7ba7031618c5b7b0849a.tar.gz yosys-7eeb656e2a8276f71c7b7ba7031618c5b7b0849a.tar.bz2 yosys-7eeb656e2a8276f71c7b7ba7031618c5b7b0849a.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)) |