Skip to content

Instantly share code, notes, and snippets.

@chapuni
Created April 15, 2014 13:22
Show Gist options
  • Save chapuni/10732188 to your computer and use it in GitHub Desktop.
Save chapuni/10732188 to your computer and use it in GitHub Desktop.
memory leak on Operands
--- a/llvm/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp
+++ b/llvm/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp
@@ -4197,6 +4197,7 @@ bool ARM64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
if (Op->isVectorIndexD() && Op->getVectorIndex() == 1) {
SMLoc Loc = Op->getStartLoc();
Operands.pop_back();
+ delete Op;
Operands.push_back(
ARM64Operand::CreateToken("[", false, Loc, getContext()));
Operands.push_back(
@@ -4218,6 +4219,7 @@ bool ARM64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
Operands.insert(
Operands.begin() + OpNo + 2,
ARM64Operand::CreateToken("]", false, Loc, getContext()));
+ delete Op;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment