mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
Fix Name Check
Avoid a potential assert by asking for record names as strings explicitly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142503 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7474c29d90
commit
0615d6aac8
@ -1629,12 +1629,12 @@ public:
|
||||
return I == Defs.end() ? 0 : I->second;
|
||||
}
|
||||
void addClass(Record *R) {
|
||||
assert(getClass(R->getName()) == 0 && "Class already exists!");
|
||||
Classes.insert(std::make_pair(R->getName(), R));
|
||||
assert(getClass(R->getNameInitAsString()) == 0 && "Class already exists!");
|
||||
Classes.insert(std::make_pair(R->getNameInitAsString(), R));
|
||||
}
|
||||
void addDef(Record *R) {
|
||||
assert(getDef(R->getName()) == 0 && "Def already exists!");
|
||||
Defs.insert(std::make_pair(R->getName(), R));
|
||||
assert(getDef(R->getNameInitAsString()) == 0 && "Def already exists!");
|
||||
Defs.insert(std::make_pair(R->getNameInitAsString(), R));
|
||||
}
|
||||
|
||||
/// removeClass - Remove, but do not delete, the specified record.
|
||||
|
Loading…
Reference in New Issue
Block a user