diff --git a/gen/dvalue.cpp b/gen/dvalue.cpp index c29eed9e..6615551b 100644 --- a/gen/dvalue.cpp +++ b/gen/dvalue.cpp @@ -68,3 +68,15 @@ LLValue* DConstValue::getRVal() ///////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////// + +Type*& DLRValue::getLType() +{ + if (DLRValue* lr = lvalue->isLRValue()) + { + return lr->getLType(); + } + else + { + return lvalue->getType(); + } +} diff --git a/gen/dvalue.h b/gen/dvalue.h index 245605e1..60d081e1 100644 --- a/gen/dvalue.h +++ b/gen/dvalue.h @@ -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; }