Opened 5 years ago

Closed 21 months ago

#129 closed defect (fixed)

Infinite Recursion in TypeSubstitution::Substituter::postmutate

Reported by: pabuhr Owned by:
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

The following code fragment causes inifinite recursion in member TypeSubstitution::Substituter::postmutate.

forall( dtype ostype ) {
    ostype & ?|?( ostype &, ostype & (*)( ostype & ) );
    ostype & nonl( ostype & );
    ostype & ?|?( ostype & os, int ) {
	os | nonl;
    }
}

Change History (2)

comment:1 Changed 5 years ago by a3moss

My best guess as to what is happening here is that that the recursion at the end of TypeSubstitution::Substituter::postmutate( TypeInstType * ) (TypeSubstitution.cc:170) is what is causing the problem.

The comment above suggests that this might be a cycle of length > 1, which could be broken more generally with a hash table instead of the current check at lines 159-163

It would be relatively easy to break the cycle, but investigating how to ensure that no cycles occur (as suggested by the TODO comment) might be more correct.

comment:2 Changed 21 months ago by Thierry Delisle

Resolution: fixed
Status: newclosed

This compiles in a finite amount of time.

Note: See TracTickets for help on using tickets.