matt-kempster / m2c

A MIPS and PowerPC decompiler.
GNU General Public License v3.0
386 stars 46 forks source link

Redundant typedef causes m2c to hang #247

Closed r-burns closed 1 year ago

r-burns commented 1 year ago

I was having trouble decompiling on m2c using an autogenerated context header, which was causing the decompilation step to hang indefinitely. I was able to trim my context down to this minimal reproducer:

typedef int foo;
typedef foo foo;
struct bar {
    foo x;
};

I initially thought this was malformed code, but mwcc and GCC will happily compile it -- either way, I think m2c shouldn't hang on this. It seems like it's getting stuck while building the typemap.