This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch, applied] fix Re: GCC build failed for native with your patch on 2003-10-06T04:42:32Z.
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: gcc-patches at gcc dot gnu dot org, gcc-regression at gcc dot gnu dot org
- Cc: gnustuff at thisiscool dot com, apinski at apple dot com, Aldy Hernandez <aldyh at redhat dot com>, kkojima at gcc dot gnu dot org, Andrew Pinski <pinskia at physics dot uc dot edu>, cgd at broadcom dot com
- Date: Sun, 5 Oct 2003 23:07:23 -0700
- Subject: [Patch, applied] fix Re: GCC build failed for native with your patch on 2003-10-06T04:42:32Z.
- References: <200310060458.h964wVXH010700@gcc-regress.apple.com>
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.)