diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-30 05:14:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-30 05:14:00 +0000 |
commit | 628c13ad76fb4b7ce2f105c0e92644d1c39ee2f8 (patch) | |
tree | eed23e90144b620e1c0560e51488e567ca9d1f83 /lib/AsmParser/LLParser.h | |
parent | fa149ae923c32f80383d3585f7d5ea3bdae5ecf4 (diff) | |
download | llvm-628c13ad76fb4b7ce2f105c0e92644d1c39ee2f8.tar.gz llvm-628c13ad76fb4b7ce2f105c0e92644d1c39ee2f8.tar.bz2 llvm-628c13ad76fb4b7ce2f105c0e92644d1c39ee2f8.tar.xz |
reimplement insertvalue/extractvalue metadata handling to not blindly
accept invalid input. Actually add a testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/LLParser.h')
-rw-r--r-- | lib/AsmParser/LLParser.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/AsmParser/LLParser.h b/lib/AsmParser/LLParser.h index 7802a1e489..b03fe52d50 100644 --- a/lib/AsmParser/LLParser.h +++ b/lib/AsmParser/LLParser.h @@ -173,7 +173,14 @@ namespace llvm { bool ParseOptionalAlignment(unsigned &Alignment); bool ParseOptionalCustomMetadata(); bool ParseOptionalInfo(unsigned &Alignment); - bool ParseIndexList(SmallVectorImpl<unsigned> &Indices); + bool ParseIndexList(SmallVectorImpl<unsigned> &Indices,bool &AteExtraComma); + bool ParseIndexList(SmallVectorImpl<unsigned> &Indices) { + bool AteExtraComma; + if (ParseIndexList(Indices, AteExtraComma)) return true; + if (AteExtraComma) + return TokError("expected index"); + return false; + } // Top-Level Entities bool ParseTopLevelEntities(); |