[cfe-dev] Crash in codegen with opaque types

Eli Friedman eli.friedman at gmail.com
Fri Jan 25 23:45:39 PST 2008


Testcase:

struct A *mjpeg_ctx;

struct A {
    struct A* M;
};

// Uncommenting the following eliminates the problem
// struct A s;

void a() {
mjpeg_ctx->M;
}

Crashes in codegen with assertion "Unable to find field info".

As far as I can tell, the issue is that when the struct gets defined,
the old type of the pointer to the struct remains in the type cache,
so the struct gets used without ever having its type created.  Not
sure what the right fix is.

-Eli



More information about the cfe-dev mailing list