Opened 6 years ago
Closed 3 years 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 by , 6 years ago
comment:2 by , 3 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
This compiles in a finite amount of time.
Note:
See TracTickets
for help on using tickets.
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-163It would be relatively easy to break the cycle, but investigating how to ensure that no cycles occur (as suggested by the
TODOcomment) might be more correct.