libfirm / cparser

C99 parser and frontend for libfirm
http://pp.ipd.kit.edu/firm
GNU General Public License v2.0
336 stars 38 forks source link

Segfault in is_Id (libFirm.so) due to misparse #56

Open ibara opened 3 years ago

ibara commented 3 years ago

Hello --

The following code causes a segfault in is_Id. Ideally, cparser should reject this code on line 6 (while (c[1])) since it makes no sense in context.

Thanks!

a;
double b;
c() {
  if (a)
    if (0 % 0)
      while (c[1])
        ;
  while ((unsigned long)b)
    ;
}