Commit f945b4e0 by Devang Patel

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


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


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

From-SVN: r65952
parent 1067694a
2003-04-22 Devang Patel <dpatel@apple.com>
* cpptrad.c (_cpp_replacement_text_len): Add check for macro parameter count.
(_cpp_copy_replacement_text): Same.
2003-04-22 Neil Booth <neil@daikokuya.co.uk> 2003-04-22 Neil Booth <neil@daikokuya.co.uk>
* c-lex.c (c_lex): Handle CPP_OTHER differently. * c-lex.c (c_lex): Handle CPP_OTHER differently.
...@@ -57,6 +63,7 @@ ...@@ -57,6 +63,7 @@
(note_eh_region_may_contain_throw): New function. (note_eh_region_may_contain_throw): New function.
* except.h (note_eh_region_may_contain_throw): New function. * except.h (note_eh_region_may_contain_throw): New function.
>>>>>>> 1.17566
2003-04-21 Mark Mitchell <mark@codesourcery.com> 2003-04-21 Mark Mitchell <mark@codesourcery.com>
* config/i386/winnt.c (i386_pe_mark_dllimport): Revert previous * config/i386/winnt.c (i386_pe_mark_dllimport): Revert previous
......
...@@ -761,7 +761,7 @@ _cpp_replacement_text_len (macro) ...@@ -761,7 +761,7 @@ _cpp_replacement_text_len (macro)
{ {
size_t len; size_t len;
if (macro->fun_like) if (macro->fun_like && (macro->paramc != 0))
{ {
const uchar *exp; const uchar *exp;
...@@ -791,7 +791,7 @@ _cpp_copy_replacement_text (macro, dest) ...@@ -791,7 +791,7 @@ _cpp_copy_replacement_text (macro, dest)
const cpp_macro *macro; const cpp_macro *macro;
uchar *dest; uchar *dest;
{ {
if (macro->fun_like) if (macro->fun_like && (macro->paramc != 0))
{ {
const uchar *exp; const uchar *exp;
......
2003-04-22 Devang Patel <dpatel@apple.com>
* gcc.dg/cpp/trad/funlike-5.c: New test.
2003-04-21 Andreas Tobler <a.tobler@schweiz.ch> 2003-04-21 Andreas Tobler <a.tobler@schweiz.ch>
* g++.dg/other/packed1.C: Fix dg options. * g++.dg/other/packed1.C: Fix dg options.
......
/* Test function like macro. */
/* Contributed by Devang Patel <dpatel@apple.com> */
/* {do-do preprocess } */
/* { dg-options "-traditional-cpp -E -dD" } */
int __srget (char *);
#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
#define getc(fp) __sgetc(fp)
#define getchar() getc(stdin)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment