[cfe-dev] Recursion in Clang FE

Sotkin, Alexey alexey.sotkin at intel.com
Tue May 26 08:15:08 PDT 2015


Hello

I build Clang FE as a shared library and link with other application. That application should never crash with any sources given for compilation.
I have a test based on this one https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gcc.c-torture/compile/limits-pointer.c . But PTR4 is changed to PTR5 at the last line. I run the test with the following command line:

clang.exe -c C:\work\tmp\limits-pointer.c

Then clang crashed with stack overflow exception caused by very deep recursion during preprocessing. And that is not the only one case.
I have noticed that there are many recursive calls in Clang's source code. And depth of recursion in many cases depends on the source code which is being compiled.

Is it possible to eliminate all such recursions in Clang?
If not, how can I workaround (if it is possible) stack overflow ?


Best regards.
Alexey Sotkin.


--------------------------------------------------------------------
Closed Joint Stock Company Intel A/O
Registered legal address: Krylatsky Hills Business Park, 
17 Krylatskaya Str., Bldg 4, Moscow 121614, 
Russian Federation

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150526/cd0a9ef1/attachment.html>


More information about the cfe-dev mailing list