mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-15 13:28:59 +00:00
rtlil.cc: Fix decode for empty string
This commit is contained in:
parent
94b44a37b2
commit
260cc42c2f
|
@ -337,7 +337,10 @@ std::string RTLIL::Const::decode_string() const
|
||||||
}
|
}
|
||||||
s.append({ch});
|
s.append({ch});
|
||||||
}
|
}
|
||||||
return s.substr(s.find_first_not_of('\0'));
|
auto first_char = s.find_first_not_of('\0');
|
||||||
|
if (first_char != std::string::npos)
|
||||||
|
return s.substr(first_char);
|
||||||
|
else return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RTLIL::Const::is_fully_zero() const
|
bool RTLIL::Const::is_fully_zero() const
|
||||||
|
|
Loading…
Reference in a new issue