[LLVMbugs] [Bug 15195] New: fatal error: parser recursion limit reached when using deeply nested parentheses

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 7 09:05:47 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=15195

            Bug ID: 15195
           Summary: fatal error: parser recursion limit reached when using
                    deeply nested parentheses
           Product: clang
           Version: 3.2
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: darwin.driggers at sas.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 9977
  --> http://llvm.org/bugs/attachment.cgi?id=9977&action=edit
Standalone source code to replicate the error message

The exact error is:
clang -c x2.c
x2.c:5389:3: fatal error: parser recursion limit reached, program too complex
{ FOO_VERSIONLONG},                       /* fixed index is 334*/
  ^
x2.c:4871:31: note: expanded from macro 'FOO_VERSIONLONG'
#define FOO_VERSIONLONG      (FOO_VERSIONLONG_IDXXX|MYFLAG)
                              ^
x2.c:584:36: note: expanded from macro 'FOO_VERSIONLONG_IDXXX'
#define FOO_VERSIONLONG_IDXXX     (FOO_VBUFSIZE_IDXXX + 1)
                                   ^

Clang version info:
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

The above error is present in the 3.2 production version of clang and with the
latest(Feb. 05, 2013) build using the source from trunk.

I was able to checkout the source for clang version 3.2 and the current trunk
and make the following change in clang/lib/Parse/RAIIObjectsForParser.h, line
374, to get around the error:
enum { MaxDepth = 2048 }; // Increase MaxDepth 

Please increase MaxDepth to a minimum of 2k.

I've verified the problem exists on MacOS X and Linux.

This bug/enhancement request appears related to bug 10752.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130207/e260bca4/attachment.html>


More information about the llvm-bugs mailing list