Append peer fragments at the end of the list (so f->blacklist() always counts against the same fragment).

This commit is contained in:
Andreas Gal 2008-08-16 11:42:38 -07:00
parent dcb470b104
commit af92aac55a

View File

@ -204,8 +204,15 @@ namespace nanojit
Fragment* Fragmento::newLoop(const void* ip)
{
Fragment *f = newFrag(ip);
f->peer = _frags->get(ip);
_frags->put(ip, f);
Fragment* p = _frags->get(ip);
if (p) {
/* append at the end of the peer list */
Fragment* next;
while ((next = p->peer) != NULL)
p = next;
p->peer = f;
} else
_frags->put(ip, f); /* this is the first fragment */
f->anchor = f;
f->root = f;
f->kind = LoopTrace;