Opened 2 years ago

Last modified 2 years ago

#129 new defect

Infinite Recursion in TypeSubstitution::Substituter::postmutate

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


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 (1)

comment:1 Changed 2 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 * ) ( 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.

Note: See TracTickets for help on using tickets.