Mercurial > projects > ldc
changeset 574:aee6217b4084
Fixed pointer comparisons with differing types.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Thu, 04 Sep 2008 17:17:40 +0200 |
parents | d300e9a049fa |
children | f0c20d50d4b3 |
files | gen/toir.cpp |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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"); } }