3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-15 03:35:40 +00:00

twine: fix another off-by-one

This commit is contained in:
Emil J. Tywoniak 2026-06-15 18:55:21 +02:00
parent d96461e40c
commit 9cb838febe
3 changed files with 2 additions and 3 deletions

View file

@ -1983,7 +1983,7 @@ namespace {
void error(int linenr)
{
std::stringstream buf;
RTLIL_BACKEND::dump_cell(buf, " ", cell);
RTLIL_BACKEND::dump_cell(buf, " ", cell, cell->module->design);
std::string mod_name = module ? module->design->twines.str(module->meta_->name) : std::string();
std::string cell_name = cell->module->design->twines.str(cell->meta_->name);

View file

@ -15,7 +15,6 @@ TwineRef twine_populate(std::string name) {
}
void twine_prepopulate() {
TwinePool::globals_.reserve(STATIC_TWINE_END);
TwinePool::globals_.push_back(Twine{std::string()});
#define X(_id) twine_populate("\\" #_id);
#include "kernel/constids.inc"
#undef X

View file

@ -265,7 +265,7 @@ struct TwinePool {
}
void rebuild_index() {
for (TwineRef ref = 0; ref < globals_.size(); ref++)
for (TwineRef ref = 0; ref < STATIC_TWINE_END; ref++)
index.insert(ref);
for (auto it = backing.begin(); it != backing.end(); ++it)
index.insert(STATIC_TWINE_END + backing.get_index(it));