This commit is contained in:
Krystine Dawn Sherwin 2026-07-23 15:14:27 -07:00 committed by GitHub
commit 7a917cd6a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 5 deletions

View File

@ -713,8 +713,7 @@ std::string RTLIL::Const::decode_string() const
ch |= 1 << j;
}
}
if (ch != 0)
s.append({ch});
s.append({ch});
}
i -= 8;
for (; i >= 0; i -= 8) {
@ -724,10 +723,12 @@ std::string RTLIL::Const::decode_string() const
ch |= 1 << j;
}
}
if (ch != 0)
s.append({ch});
s.append({ch});
}
return s;
auto first_char = s.find_first_not_of('\0');
if (first_char != std::string::npos)
return s.substr(first_char);
else return s;
}
int RTLIL::Const::size() const {