mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-19 16:35:10 +00:00
Fix PR4207.
If we're resolving a list element access and we're given a VarInit, return a new VarListElementInit referencing the VarInit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71787 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2b2c0d716a
commit
ccf85ded58
@ -639,7 +639,11 @@ Init *VarInit::resolveListElementReference(Record &R, const RecordVal *IRV,
|
||||
RecordVal *RV = R.getValue(getName());
|
||||
assert(RV && "Reference to a non-existant variable?");
|
||||
ListInit *LI = dynamic_cast<ListInit*>(RV->getValue());
|
||||
assert(LI && "Invalid list element!");
|
||||
if (!LI) {
|
||||
VarInit *VI = dynamic_cast<VarInit*>(RV->getValue());
|
||||
assert(VI && "Invalid list element!");
|
||||
return new VarListElementInit(VI, Elt);
|
||||
}
|
||||
|
||||
if (Elt >= LI->getSize())
|
||||
return 0; // Out of range reference.
|
||||
|
Loading…
x
Reference in New Issue
Block a user