[PATCH] -traditional-cpp crash

Devang Patel dpatel@apple.com
Tue Apr 22 00:10:00 GMT 2003

I encountered this while investigating unix utility 'top' build failure 
Darwin. ICE occurs when "-traditional-cpp -E -dD" compiler options
are used to preprocess included test case.

In save_replacement_text() for macros, if parameter count is zero then
text is directly saved in macro->exp and macro->count keeps the length.
If parameter count is not zero than blocks (struct block) are used to 
text and length.  So, while replacing text or calculating length, we 
this check.

I have bootstrapped and ran dejagnu tests with this fix in Darwin
gcc sources. I am doing the same with FSF TOT sources right now.

OK to commit if I do not find any new test failures ?
OK  for gcc-3.3 ?

Thank you,

  2003-04-21  Devang Patel  <dpatel@apple.com>

        * cpptrad.c (_cpp_replacement_text_len): Add check for macro 
parameter count.
        (_cpp_copy_replacement_text): Same.


  2003-04-21  Devang Patel  <dpatel@apple.com>

        * gcc.dg/cpp/trad/funlike-5.c: New test.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: traditional_cpp_crash.diff
Type: application/octet-stream
Size: 1289 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030422/dfe26517/attachment.obj>

More information about the Gcc-patches mailing list