Fixed DLRValue::getLType did not handle the lvalue being a LRValue itself properly.

This commit is contained in:
Tomas Lindquist Olsen
2008-09-15 15:17:41 +02:00
parent be651d97b7
commit c9242e3fbe
2 changed files with 13 additions and 1 deletions

View File

@@ -68,3 +68,15 @@ LLValue* DConstValue::getRVal()
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
Type*& DLRValue::getLType()
{
if (DLRValue* lr = lvalue->isLRValue())
{
return lr->getLType();
}
else
{
return lvalue->getType();
}
}

View File

@@ -162,7 +162,7 @@ struct DLRValue : DValue
virtual LLValue* getLVal() { return lvalue->isLVal() ? lvalue->getLVal() : lvalue->getRVal(); }
virtual LLValue* getRVal() { return rvalue->getRVal(); }
Type*& getLType() { return lvalue->getType(); }
Type*& getLType();
Type*& getRType() { return rvalue->getType(); }
virtual Type*& getType() { return getRType(); }
virtual DLRValue* isLRValue() { return this; }