1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[TableGen] Fix a memory leak when creating SwitchOpcodeMatchers.

llvm-svn: 268712
This commit is contained in:
Craig Topper 2016-05-06 06:56:14 +00:00
parent 8363434141
commit 79fd28882b

View File

@ -383,7 +383,8 @@ static void FactorNodes(std::unique_ptr<Matcher> &MatcherPtr) {
CheckOpcodeMatcher *COM = cast<CheckOpcodeMatcher>(NewOptionsToMatch[i]);
assert(Opcodes.insert(COM->getOpcode().getEnumName()).second &&
"Duplicate opcodes not factored?");
Cases.push_back(std::make_pair(&COM->getOpcode(), COM->getNext()));
Cases.push_back(std::make_pair(&COM->getOpcode(), COM->takeNext()));
delete COM;
}
MatcherPtr.reset(new SwitchOpcodeMatcher(Cases));