diff gen/toir.cpp @ 629:607b6b5819a7

Fixed issue with IsExpression and potential type mismatch for classes.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Wed, 01 Oct 2008 20:55:13 +0200
parents e3c46bcce65f
children 0084d2c76b74
line wrap: on
line diff
--- a/gen/toir.cpp	Wed Oct 01 20:32:12 2008 +0200
+++ b/gen/toir.cpp	Wed Oct 01 20:55:13 2008 +0200
@@ -1954,7 +1954,7 @@
         ?   p->ir->CreateFCmpOEQ(l,r,"tmp")
         :   p->ir->CreateFCmpONE(l,r,"tmp");
     }
-    else if (t1->ty == Tpointer)
+    else if (t1->ty == Tpointer || t1->ty == Tclass)
     {
         if (l->getType() != r->getType()) {
             if (v->isNull())
@@ -1967,6 +1967,7 @@
         :   p->ir->CreateICmpNE(l,r,"tmp");
     }
     else {
+        assert(l->getType() == r->getType());
         eval = (op == TOKidentity)
         ?   p->ir->CreateICmpEQ(l,r,"tmp")
         :   p->ir->CreateICmpNE(l,r,"tmp");