Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49890 - trunk/tools/jam/src
From: grafikrobot_at_[hidden]
Date: 2008-11-23 00:33:28


Author: grafik
Date: 2008-11-23 00:33:26 EST (Sun, 23 Nov 2008)
New Revision: 49890
URL: http://svn.boost.org/trac/boost/changeset/49890

Log:
Try to work around at least one compiler bug with GCC and variable aliasing that causes crashes with hashing file cache entries.
Text files modified:
   trunk/tools/jam/src/filesys.c | 13 +++++++------
   1 files changed, 7 insertions(+), 6 deletions(-)

Modified: trunk/tools/jam/src/filesys.c
==============================================================================
--- trunk/tools/jam/src/filesys.c (original)
+++ trunk/tools/jam/src/filesys.c 2008-11-23 00:33:26 EST (Sun, 23 Nov 2008)
@@ -34,24 +34,25 @@
 }
 
 static struct hash * filecache_hash = 0;
+static file_info_t filecache_finfo;
 
 file_info_t * file_info(char * filename)
 {
- file_info_t finfo_, *finfo = &finfo_;
+ file_info_t *finfo = &filecache_finfo;
 
     if ( !filecache_hash )
         filecache_hash = hashinit( sizeof( file_info_t ), "file_info" );
 
     finfo->name = filename;
+ finfo->is_file = 0;
+ finfo->is_dir = 0;
+ finfo->size = 0;
+ finfo->time = 0;
+ finfo->files = 0;
     if ( hashenter( filecache_hash, (HASHDATA**)&finfo ) )
     {
         /* printf( "file_info: %s\n", filename ); */
         finfo->name = newstr( finfo->name );
- finfo->is_file = 0;
- finfo->is_dir = 0;
- finfo->size = 0;
- finfo->time = 0;
- finfo->files = 0;
     }
 
     return finfo;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk