Skip to content

Commit

Permalink
Fix merging of super type of classes
Browse files Browse the repository at this point in the history
Forward declarations will not provide information about base types.
When base type information is available later, it must be merged.
An example of a (previously) missed super type is:
  class MM_Scavenger : public MM_Collector

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
  • Loading branch information
keithc-ca committed Jul 17, 2019
1 parent 76f72d5 commit 123fa40
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ddr/lib/ddr-ir/Symbol_IR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,21 @@ MergeVisitor::visitComposite(ClassType *type) const
DDR_RC
MergeVisitor::visitClass(ClassUDT *type) const
{
if (NULL == type->_superClass) {
ClassUDT *otherSuper = ((ClassUDT *)_other)->_superClass;

if (NULL != otherSuper) {
Type *thisSuper = _ir->findTypeInMap(otherSuper);

if (NULL != thisSuper) {
otherSuper = (ClassUDT *)thisSuper;
} else {
_merged->push_back(otherSuper);
}
type->_superClass = otherSuper;
}
}

return visitComposite(type);
}

Expand Down

0 comments on commit 123fa40

Please sign in to comment.