From 0615d6aac810059a37fbced0f315cce75476da49 Mon Sep 17 00:00:00 2001 From: David Greene Date: Wed, 19 Oct 2011 13:02:48 +0000 Subject: [PATCH] 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 --- include/llvm/TableGen/Record.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/llvm/TableGen/Record.h b/include/llvm/TableGen/Record.h index 206718ce95a..34c8aa977f5 100644 --- a/include/llvm/TableGen/Record.h +++ b/include/llvm/TableGen/Record.h @@ -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. -- 2.34.1