This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] gcc-3.3


I found a small problem in gcc.c. This is only a problem on the 3.3
branch because CPP_PREDEFINES has been removed in the 3.4 release.
The problem is that alloca does not allocate enough memory. There
should be room for two ' ' and one '\0' character.
I do not have write permission so can not make the change after aproval.

	Herman.

2003-08-21 Herman A.J. ten Brugge <hermantenbrugge@home.nl>

	* gcc.c: Allocate enough memory for cpp_predefines.


--- gcc.c.org	2003-08-21 19:12:47.000000000 +0200
+++ gcc.c	2003-08-21 19:13:01.000000000 +0200
@@ -4775,7 +4775,7 @@ do_spec_1 (spec, inswitch, soft_matched_
 
 	  case 'P':
 	    {
-	      char *x = (char *) alloca (strlen (cpp_predefines) * 4 + 1);
+	      char *x = (char *) alloca (strlen (cpp_predefines) * 4 + 3);
 	      char *buf = x;
 	      const char *y;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]