LibFile complains about lack of memory

Nick Burrett nick at dsvr.net
Fri Aug 16 08:23:27 PDT 2002


Timothy Baldwin wrote:

> A couple more bugs:
> The number of used chunks is written incorrectly in the library header.
> The symbol table give incorrect chunks for newly inserted objects.

> diff -burN gccsdk-old/riscos-aof/libfile/Library.cc 
> gccsdk2/riscos-aof/libfile/Library.cc
> - - --- gccsdk-old/riscos-aof/libfile/Library.cc	Sun Jul 28 11:18:13 2002
> +++ gccsdk2/riscos-aof/libfile/Library.cc	Sun Aug 11 14:00:36 2002
> @@ -50,7 +50,7 @@
>   m_data.putInt(members);
>  
>   // Number of used chunks
> - - - m_data.putInt(members - 1);
> + m_data.putInt(members);
> 
>   // Get current timestamp
>   m_time->set();
> 

The above patch looks is a reversion of the following change:

[riscos at nick libfile]$ cvs log -r1.3.2.2 Library.cc

RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/libfile/Library.cc,v
Working file: Library.cc
head: 1.4
branch:
locks: strict
access list:
symbolic names:
	merge_release_2_95_to_mainline_20020214: 1.3.2.2
	release_2_95_4_v1: 1.3.2.2
	release_2_95: 1.3.0.2
	release_2_0_0: 1.1.1.1
	gccsdk: 1.1.1
keyword substitution: kv
total revisions: 7;	selected revisions: 1
description:
----------------------------
revision 1.3.2.2
date: 2001/09/11 09:09:13;  author: admin;  state: Exp;  lines: +1 -1
(Library::build): Fix off-by-one error for the setting of the number
of used chunks.  This caused libfile to set the wrong chunk number for
new chunks added to an old library.
=============================================================================


[riscos at nick libfile]$ cvs diff -u -r1.3.2.1 -r1.3.2.2 Library.cc
Index: Library.cc
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/libfile/Library.cc,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -r1.3.2.1 -r1.3.2.2
--- Library.cc	16 Aug 2001 11:28:25 -0000	1.3.2.1
+++ Library.cc	11 Sep 2001 09:09:13 -0000	1.3.2.2
@@ -50,7 +50,7 @@
   m_data.putInt(members);

   // Number of used chunks
- m_data.putInt(members);
+ m_data.putInt(members - 1);

   // Get current timestamp
   m_time->set();



My change was made to fix the following issue:
http://hard-mofo.dsvr.net/gcc/mail-archive/gcc/200109/0517.html


Are you sure your change doesn't resurrect this problem ?

Regards,


Nick.


-- 
Nick Burrett
Development Manager, Designer Servers Ltd.   http://www.dsvr.co.uk




More information about the gcc mailing list