aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/Record.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen/Record.cpp')
-rw-r--r--utils/TableGen/Record.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp
index 2e64c83..d420e63 100644
--- a/utils/TableGen/Record.cpp
+++ b/utils/TableGen/Record.cpp
@@ -639,8 +639,12 @@ 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.
Init *E = LI->getElement(Elt);