From: Johann Glaser Date: Mon, 18 Mar 2013 19:58:47 +0000 (+0100) Subject: fixed a crash when lines start with whitespace X-Git-Tag: yosys-0.2.0~711^2~6 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=15ad2db8fc4e608d05e87d4d447cb0a5f1081c95;p=yosys.git fixed a crash when lines start with whitespace --- 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 args, size_t argidx, RTLIL::Desig void Pass::call(RTLIL::Design *design, std::string command) { std::vector 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); }