mirror of
https://github.com/RPCS3/llvm.git
synced 2026-01-31 01:25:19 +01:00
[BitCode] Diagnose GEPs with no indices
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271849 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3090,6 +3090,9 @@ std::error_code BitcodeReader::parseConstants() {
|
||||
return error("Explicit gep operator type does not match pointee type "
|
||||
"of pointer operand");
|
||||
|
||||
if (Elts.size() < 1)
|
||||
return error("Invalid gep with no operands");
|
||||
|
||||
ArrayRef<Constant *> Indices(Elts.begin() + 1, Elts.end());
|
||||
V = ConstantExpr::getGetElementPtr(PointeeType, Elts[0], Indices,
|
||||
BitCode ==
|
||||
|
||||
Reference in New Issue
Block a user