diff --git a/src/mapleall/maple_me/src/alias_class.cpp b/src/mapleall/maple_me/src/alias_class.cpp index 24138cc294ca9a2c93b6399bded654f0ba115187..a0ad6bd92f6eb95c65da4e373cb831ed7d47acc3 100644 --- a/src/mapleall/maple_me/src/alias_class.cpp +++ b/src/mapleall/maple_me/src/alias_class.cpp @@ -771,11 +771,17 @@ void AliasClass::ApplyUnionForPointedTos() { MapleVector *nextLevelNodes1 = GetAliasAnalysisTable()->GetNextLevelNodes(ae1->GetOriginalSt()); MapleVector::iterator ost1it = nextLevelNodes1->begin(); for (; ost1it != nextLevelNodes1->end(); ++ost1it) { + MIRType *mirType1 = GlobalTables::GetTypeTable().GetTypeFromTyIdx((*ost1it)->GetTyIdx()); + bool ost1IsAgg = mirType1->GetPrimType() == PTY_agg; + MapleVector *nextLevelNodes2 = GetAliasAnalysisTable()->GetNextLevelNodes(ae2->GetOriginalSt()); MapleVector::iterator ost2it = nextLevelNodes2->begin(); for (; ost2it != nextLevelNodes2->end(); ++ost2it) { bool hasFieldid0 = (*ost1it)->GetFieldID() == 0 || (*ost2it)->GetFieldID() == 0; - if (((*ost1it)->GetFieldID() != (*ost2it)->GetFieldID()) && !hasFieldid0) { + MIRType *mirType2 = GlobalTables::GetTypeTable().GetTypeFromTyIdx((*ost2it)->GetTyIdx()); + bool ost2IsAgg = mirType2->GetPrimType() == PTY_agg; + bool hasAggType = ost1IsAgg || ost2IsAgg; + if (((*ost1it)->GetFieldID() != (*ost2it)->GetFieldID()) && !hasFieldid0 && !hasAggType) { continue; } if (((*ost1it)->IsFinal() || (*ost2it)->IsFinal())) {