2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 13:42:14 +00:00

Try to work around at least one compiler bug with GCC and variable aliasing that causes crashes with hashing file cache entries.

[SVN r49890]
This commit is contained in:
Rene Rivera
2008-11-23 05:33:26 +00:00
parent 908cc27602
commit fa90e901d0

View File

@@ -34,24 +34,25 @@ void file_build1( PATHNAME * f, string * file )
}
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;