a0855aa193fcecca99ebaf6b3ac049bfa2622b0c
1 #include "loopDetector.hh"
4 bool loopDetector::detect(Tree t
)
7 int w
= fPhase
%fBuffersize
;
9 if ((fPhase
%fCheckperiod
) == 0) {
10 // time to check for a cycle
11 for (int i
=1; i
<fBuffersize
; i
++) {
12 int r
= w
-i
; if (r
< 0) { r
+= fBuffersize
; }
14 assert(r
<fBuffersize
);
16 if (fBuffer
[r
] == t
) {
17 cerr
<< "ERROR : after "
19 << " evaluation steps, the compiler has detected an endless evaluation cycle of "