aboutsummaryrefslogtreecommitdiff
path: root/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-07-24 21:56:17 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-07-24 21:56:17 +0000
commit4e9bac3769cb668aad20f1ac2d6a35d9ba452f3a (patch)
treea177b968364f6a7617362c4ba589f7aeee787b00 /lib/AsmParser/LLParser.cpp
parent0b6afa8c71f3ee32d42390c0c46c28ff31aa6325 (diff)
Fix assert assembling zero-argument constant GEP.
There's still a strict-aliasing violation here, but I don't feel like dealing with that right now... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
-rw-r--r--lib/AsmParser/LLParser.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index 94224a6361..45e70c8f9c 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -2017,10 +2017,11 @@ bool LLParser::ParseValID(ValID &ID) {
return Error(ID.Loc, "getelementptr requires pointer operand");
if (!GetElementPtrInst::getIndexedType(Elts[0]->getType(),
- (Value**)&Elts[1], Elts.size()-1))
+ (Value**)(Elts.data() + 1),
+ Elts.size() - 1))
return Error(ID.Loc, "invalid indices for getelementptr");
ID.ConstantVal = Context.getConstantExprGetElementPtr(Elts[0],
- &Elts[1], Elts.size()-1);
+ Elts.data() + 1, Elts.size() - 1);
} else if (Opc == Instruction::Select) {
if (Elts.size() != 3)
return Error(ID.Loc, "expected three operands to select");