3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-02-21 15:57:36 +00:00
This commit is contained in:
Robert O'Callahan 2026-02-13 01:11:30 -05:00 committed by GitHub
commit c742785b65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 2115 additions and 562 deletions

View file

@ -286,6 +286,7 @@ struct RTLILFrontendWorker {
if (width > MAX_CONST_WIDTH)
error("Constant width %lld out of range before `%s`.", width, error_token());
bits.reserve(width);
int start_idx = idx;
while (true) {
RTLIL::State bit;
switch (line[idx]) {
@ -300,8 +301,9 @@ struct RTLILFrontendWorker {
bits.push_back(bit);
++idx;
}
done:
std::reverse(bits.begin(), bits.end());
done:
if (start_idx < idx)
std::reverse(bits.begin(), bits.end());
if (GetSize(bits) > width)
bits.resize(width);