forked from OSchip/llvm-project
[TableGen] Fix a memory leak when creating SwitchOpcodeMatchers.
llvm-svn: 268712
This commit is contained in:
parent
332dd6614a
commit
c6b3669884
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue