diff options
author | Johann Glaser <Johann.Glaser@gmx.at> | 2013-03-18 20:58:47 +0100 |
---|---|---|
committer | Johann Glaser <Johann.Glaser@gmx.at> | 2013-03-18 20:58:47 +0100 |
commit | 15ad2db8fc4e608d05e87d4d447cb0a5f1081c95 (patch) | |
tree | b16c91b3ec4a6a2f3195f38fe86d95497702150f | |
parent | 2192873daa7915aa034e9afd1fe82efbc61320d1 (diff) | |
download | yosys-15ad2db8fc4e608d05e87d4d447cb0a5f1081c95.tar.gz yosys-15ad2db8fc4e608d05e87d4d447cb0a5f1081c95.tar.bz2 yosys-15ad2db8fc4e608d05e87d4d447cb0a5f1081c95.zip |
fixed a crash when lines start with whitespace
-rw-r--r-- | kernel/register.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/register.cc b/kernel/register.cc index ebb834c8f..a61548b64 100644 --- a/kernel/register.cc +++ b/kernel/register.cc @@ -132,7 +132,7 @@ void Pass::extra_args(std::vector<std::string> args, size_t argidx, RTLIL::Desig void Pass::call(RTLIL::Design *design, std::string command) { std::vector<std::string> args; - char *s = strdup(command.c_str()), *saveptr; + char *s = strdup(command.c_str()), *sstart = s, *saveptr; s += strspn(s, " \t\r\n"); if (*s == 0 || *s == '#') return; @@ -160,7 +160,7 @@ void Pass::call(RTLIL::Design *design, std::string command) } else args.push_back(str); } - free(s); + free(sstart); call(design, args); } |