aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/blif/blifparse.cc
diff options
context:
space:
mode:
authorArchie <ac11018@ic.ac.uk>2022-06-14 14:17:00 +0100
committerLofty <dan.ravensloft@gmail.com>2022-06-22 00:34:49 +0100
commit7eeb656e2a8276f71c7b7ba7031618c5b7b0849a (patch)
tree448ddc4074cda2b8820e433c48ac83d43e6bc9f9 /frontends/blif/blifparse.cc
parent1fdbb42fdd51aa940e4331cdf5b4d1ff56738658 (diff)
downloadyosys-7eeb656e2a8276f71c7b7ba7031618c5b7b0849a.tar.gz
yosys-7eeb656e2a8276f71c7b7ba7031618c5b7b0849a.tar.bz2
yosys-7eeb656e2a8276f71c7b7ba7031618c5b7b0849a.zip
Add check for BLIF with no model name
Diffstat (limited to 'frontends/blif/blifparse.cc')
-rw-r--r--frontends/blif/blifparse.cc5
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))