| Index: src/types.cc
|
| diff --git a/src/types.cc b/src/types.cc
|
| index db638ed141d604e95ffe7ab9f9099aac0ba34a2d..da86ef2398130ec2dad1195e05d53b6d5def2e8d 100644
|
| --- a/src/types.cc
|
| +++ b/src/types.cc
|
| @@ -313,16 +313,12 @@ bool TypeImpl<Config>::SlowIs(TypeImpl* that) {
|
|
|
| // T <= (T1 \/ ... \/ Tn) <=> (T <= T1) \/ ... \/ (T <= Tn)
|
| // (iff T is not a union)
|
| - ASSERT(!this->IsUnion());
|
| - if (that->IsUnion()) {
|
| - UnionHandle unioned = handle(that->AsUnion());
|
| - for (int i = 0; i < unioned->Length(); ++i) {
|
| - if (this->Is(unioned->Get(i))) return true;
|
| - if (this->IsBitset()) break; // Fast fail, only first field is a bitset.
|
| - }
|
| - return false;
|
| + ASSERT(!this->IsUnion() && that->IsUnion());
|
| + UnionHandle unioned = handle(that->AsUnion());
|
| + for (int i = 0; i < unioned->Length(); ++i) {
|
| + if (this->Is(unioned->Get(i))) return true;
|
| + if (this->IsBitset()) break; // Fast fail, only first field is a bitset.
|
| }
|
| -
|
| return false;
|
| }
|
|
|
| @@ -382,11 +378,8 @@ bool TypeImpl<Config>::Maybe(TypeImpl* that) {
|
| }
|
|
|
| ASSERT(!this->IsUnion() && !that->IsUnion());
|
| - if (this->IsBitset()) {
|
| - return BitsetType::IsInhabited(this->AsBitset() & that->BitsetLub());
|
| - }
|
| - if (that->IsBitset()) {
|
| - return BitsetType::IsInhabited(this->BitsetLub() & that->AsBitset());
|
| + if (this->IsBitset() || that->IsBitset()) {
|
| + return BitsetType::IsInhabited(this->BitsetLub() & that->BitsetLub());
|
| }
|
| if (this->IsClass()) {
|
| return that->IsClass()
|
|
|