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, applied] fix Re: GCC build failed for native with your patch on 2003-10-06T04:42:32Z.


This is one is mine.
I should have check some more, the problem was I had some off by one errors woops.



This what I applied: ChangeLog: * config/darwin.c (machopic_non_lazy_ptr_name): Fix off by one errors in memcpy destinations. (machopic_stub_name): Likewise.


--- darwin.c Sun Oct 5 17:44:14 2003 +++ darwin.new.c Sun Oct 5 22:45:14 2003 @@ -304,17 +304,17 @@ machopic_non_lazy_ptr_name (const char * bufferlen = 2; if (name[0] == '*') { - memcpy (buffer+bufferlen, name+1, namelen-1+1); + memcpy (buffer + bufferlen +1, name+1, namelen-1+1); bufferlen += namelen-1; } else { buffer[bufferlen] = '_'; - memcpy (buffer+bufferlen+1, name, namelen+1); + memcpy (buffer + bufferlen+1 +1, name, namelen+1); bufferlen += namelen; }

- memcpy (buffer + bufferlen, "$non_lazy_ptr", strlen("$non_lazy_ptr")+1);
+ memcpy (buffer + bufferlen +1, "$non_lazy_ptr", strlen("$non_lazy_ptr")+1);
bufferlen += strlen("$non_lazy_ptr");
ptr_name = get_identifier (buffer);


@@ -379,24 +379,24 @@ machopic_stub_name (const char *name)

     if (name[0] == '*')
       {
-	memcpy (buffer + bufferlen, name+1, namelen - 1 +1);
+	memcpy (buffer + bufferlen +1, name+1, namelen - 1 +1);
         bufferlen += namelen - 1;
       }
     else
       {
 	buffer[bufferlen] = '_';
-	memcpy (buffer + bufferlen +1, name, namelen+1);
+	memcpy (buffer + bufferlen+1 +1, name, namelen+1);
         bufferlen += namelen;
       }

     if (needs_quotes)
       {
-        memcpy (buffer + bufferlen, "$stub\"", strlen("$stub\""));
+        memcpy (buffer + bufferlen +1, "$stub\"", strlen("$stub\""));
         bufferlen += strlen("$stub\"");
       }
     else
       {
-        memcpy (buffer + bufferlen, "$stub", strlen("$stub"));
+        memcpy (buffer + bufferlen +1, "$stub", strlen("$stub"));
         bufferlen += strlen("$stub");
       }
     ptr_name = get_identifier (buffer);






Thanks, Andrew Pinski apinski@apple.com pinskia@physics.uc.edu pinskia@gcc.gnu.org


On Oct 5, 2003, at 21:58, GCC regression checker wrote:


With your recent patch, GCC does not compile on:
 native
Attached is build output for those targets.

The build failures are new.

For more information, see http://gcc.gnu.org/regtest/.
<ChangeLog.diff><native-log.txt>--
Geoffrey Keating <geoffk@apple.com>
(via an automated GCC regression-testing script.)


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