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:
parent
8363434141
commit
79fd28882b
@ -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
Block a user