diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 3d4a3547b0d..bd342a2473c 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -39,8 +39,10 @@ Method::~Method() { } // Specialize setName to take care of symbol table majik -void Method::setName(const string &name) { +void Method::setName(const string &name, SymbolTable *ST) { Module *P; + assert((ST == 0 || (!getParent() || ST == getParent()->getSymbolTable())) && + "Invalid symtab argument!"); if ((P = getParent()) && hasName()) P->getSymbolTable()->remove(this); Value::setName(name); if (P && getName() != "") P->getSymbolTableSure()->insert(this); diff --git a/lib/VMCore/InstrTypes.cpp b/lib/VMCore/InstrTypes.cpp index d0c410051a5..dbace177a98 100644 --- a/lib/VMCore/InstrTypes.cpp +++ b/lib/VMCore/InstrTypes.cpp @@ -25,8 +25,10 @@ TerminatorInst::TerminatorInst(unsigned iType) //===----------------------------------------------------------------------===// // Specialize setName to take care of symbol table majik -void MethodArgument::setName(const string &name) { +void MethodArgument::setName(const string &name, SymbolTable *ST) { Method *P; + assert((ST == 0 || (!getParent() || ST == getParent()->getSymbolTable())) && + "Invalid symtab argument!"); if ((P = getParent()) && hasName()) P->getSymbolTable()->remove(this); Value::setName(name); if (P && hasName()) P->getSymbolTable()->insert(this);