ValueSymTab::insert can loop infinitely #1568
Labels
bugzilla
Issues migrated from bugzilla
compile-fail
Use [accepts-invalid] and [rejects-valid] instead
llvm:core
Extended Description
When llvm-upgrade calls Value::setName from setValueName it ends up attempting
to insert a value in the symbol table. This can recurse infinitely in this loop:
// Otherwise, there is a naming conflict. Rename this value.
std::string UniqueName = V->getName();
unsigned BaseSize = UniqueName.size();
do {
// Trim any suffix off.
UniqueName.resize(BaseSize);
UniqueName += utostr(++LastUnique);
// Try insert the vmap entry with this suffix.
} while (!vmap.insert(make_pair(UniqueName, V)).second);
Last night's nightly test was halted by this. It looped 22,821,681,606 times
before I broke into it with the debugger. Its unclear why the map is refusing to
insert the new name.
The text was updated successfully, but these errors were encountered: