Commit 155d49d7 by Andrew Pinski Committed by Tom Tromey

re PR java/18091 (Valgrind errors building libjava)

2005-01-20  Andrew Pinski  <pinskia@gcc.gnu.org>

	PR java/18091:
	* jcf-write.c (perform_relocations): Don't call memcpy if source
	and destination are the same.

From-SVN: r94007
parent 4ef69b83
2005-01-20 Andrew Pinski <pinskia@gcc.gnu.org>
PR java/18091:
* jcf-write.c (perform_relocations): Don't call memcpy if source
and destination are the same.
2005-01-17 Tom Tromey <tromey@redhat.com>
* verify-impl.c (get_short): Sign extend.
......
/* Write out a Java(TM) class file.
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
......@@ -2794,7 +2794,9 @@ perform_relocations (struct jcf_partial *state)
int n = (old_ptr - old_buffer) - start;
new_ptr -= n;
old_ptr -= n;
if (n > 0)
/* Don't "copy" bytes in place, this causes valgrind
warnings. */
if (n > 0 && new_ptr != old_ptr)
memcpy (new_ptr, old_ptr, n);
if (old_ptr == old_buffer)
break;
......
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