# HG changeset patch # User Tomas Lindquist Olsen # Date 1220541460 -7200 # Node ID aee6217b40848dfa3b6bbd66dc32c4cd9d1a150d # Parent d300e9a049facc972cdff926145aa4b5dd7b978c Fixed pointer comparisons with differing types. diff -r d300e9a049fa -r aee6217b4084 gen/toir.cpp --- a/gen/toir.cpp Thu Sep 04 17:05:51 2008 +0200 +++ b/gen/toir.cpp Thu Sep 04 17:17:40 2008 +0200 @@ -1171,7 +1171,6 @@ Type* t = e1->type->toBasetype(); Type* e2t = e2->type->toBasetype(); - assert(DtoType(t) == DtoType(e2t)); LLValue* eval = 0; @@ -1221,6 +1220,8 @@ LLValue* b = r->getRVal(); Logger::cout() << "type 1: " << *a << '\n'; Logger::cout() << "type 2: " << *b << '\n'; + if (a->getType() != b->getType()) + b = DtoBitCast(b, a->getType()); eval = p->ir->CreateICmp(cmpop, a, b, "tmp"); } }