changeset 601:03a5e609eef3

Fixed DLRValue::getLType did not handle the lvalue being a LRValue itself properly.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Mon, 15 Sep 2008 15:17:41 +0200
parents 311f16f26297
children 48f079b4fe0f
files gen/dvalue.cpp gen/dvalue.h
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gen/dvalue.cpp	Mon Sep 15 02:39:55 2008 +0200
+++ b/gen/dvalue.cpp	Mon Sep 15 15:17:41 2008 +0200
@@ -68,3 +68,15 @@
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////////////
+
+Type*& DLRValue::getLType()
+{
+    if (DLRValue* lr = lvalue->isLRValue())
+    {
+        return lr->getLType();
+    }
+    else
+    {
+        return lvalue->getType();
+    }
+}
--- a/gen/dvalue.h	Mon Sep 15 02:39:55 2008 +0200
+++ b/gen/dvalue.h	Mon Sep 15 15:17:41 2008 +0200
@@ -162,7 +162,7 @@
     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; }