Add interface comparison to EqualExp: just do pointer comparison.

Fixes run/b/bug_e2ir_1786_B,C.
This commit is contained in:
Christian Kamm
2008-08-15 22:41:47 +02:00
parent 2b2291952c
commit 60617d5444

View File

@@ -1288,9 +1288,11 @@ DValue* EqualExp::toElem(IRState* p)
LLValue* eval = 0;
if (t->isintegral() || t->ty == Tpointer)
// the Tclass catches interface comparisons, regular
// class equality should be rewritten as a.opEquals(b) by this time
if (t->isintegral() || t->ty == Tpointer || t->ty == Tclass)
{
Logger::println("integral or pointer");
Logger::println("integral or pointer or interface");
llvm::ICmpInst::Predicate cmpop;
switch(op)
{