ARMAsmParser: Plug a memory leak.

llvm-svn: 117648
This commit is contained in:
Benjamin Kramer 2010-10-29 09:43:39 +00:00
parent 91d7b90185
commit 08b8c534f7
1 changed files with 3 additions and 2 deletions

View File

@ -464,9 +464,10 @@ ARMOperand *ARMAsmParser::ParseMemory() {
return 0;
}
int BaseRegNum = 0;
if (ARMOperand *Op = MaybeParseRegister(false))
if (ARMOperand *Op = MaybeParseRegister(false)) {
BaseRegNum = Op->getReg();
else {
delete Op;
} else {
Error(BaseRegTok.getLoc(), "register expected");
return 0;
}