From 82a3786f2ab576e3eb37a6544e0c4be9d2074cd6 Mon Sep 17 00:00:00 2001 From: Fred Chow Date: Fri, 21 May 2021 12:24:14 -0700 Subject: [PATCH] non-zero field-id with struct type can overlap with other non-zero field-id --- src/mapleall/maple_me/src/alias_class.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mapleall/maple_me/src/alias_class.cpp b/src/mapleall/maple_me/src/alias_class.cpp index 24138cc294..a0ad6bd92f 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())) { -- Gitee