﻿id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc
266	Increment hoisted outside the loop	Thierry Delisle		"In the following code:
{{{
forall(T&)
struct A {
    T * next;
};

struct B {
    A(B) link;
};

void baz() {
    for(B ** it;;it = &(*it)->link.next) {}
}
}}}

The for loop is codegened as:
{{{
void _X3bazFv___1(){
    {
        struct B **_X2itPPS1B_3;
        struct B **_dtype_static_member_245 = ((struct B **)(&(*(*_X2itPPS1B_3))._X4linkS1A_S1B__1._X4nextPY12__T_generic__1));
        for (;;((void)(_X2itPPS1B_3=_dtype_static_member_245))) {
        }
    }
}
}}}
This moves the loop increment outside the actual loop, which causes infinite loops.

The problem is probably either in Instantiate Generic pass or in the Pass visitor.

Instantiate Generic is the pass creating the variable `_dtype_static_member_245`, searching from src/GenPoly/InstantiateGenericNew.cpp:384 (as of time of writing) should yield the namer.

It could also be because the pass visitor needs to handle stmts_to_add better in this case."	defect	closed	major	cfa-cc	1.0	fixed		
