Index: src/interface.cc |
diff --git a/src/interface.cc b/src/interface.cc |
index e344b8615040ae0b425f2e130203ba9d2eb8f224..7836110e5f01e49e430db917ae650d38ce4dfe65 100644 |
--- a/src/interface.cc |
+++ b/src/interface.cc |
@@ -79,7 +79,7 @@ void Interface::DoAdd( |
PrintF("%*sthis = ", Nesting::current(), ""); |
this->Print(Nesting::current()); |
PrintF("%*s%s : ", Nesting::current(), "", |
- (*reinterpret_cast<String**>(name))->ToAsciiArray()); |
+ (*static_cast<String**>(name))->ToAsciiArray()); |
interface->Print(Nesting::current()); |
} |
#endif |
@@ -97,7 +97,7 @@ void Interface::DoAdd( |
#ifdef DEBUG |
Nesting nested; |
#endif |
- reinterpret_cast<Interface*>(p->value)->Unify(interface, ok); |
+ static_cast<Interface*>(p->value)->Unify(interface, ok); |
} |
#ifdef DEBUG |
@@ -180,6 +180,15 @@ void Interface::DoUnify(Interface* that, bool* ok) { |
return; |
} |
+ // Merge instance. |
+ if (!that->instance_.is_null()) { |
+ if (!this->instance_.is_null() && *this->instance_ != *that->instance_) { |
+ *ok = false; |
+ return; |
+ } |
+ this->instance_ = that->instance_; |
+ } |
+ |
// Merge interfaces. |
this->flags_ |= that->flags_; |
that->forward_ = this; |