diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-09 14:34:57 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-09 14:34:57 (GMT) |
commit | 15b28ad04ab6894cfd308d7855798b6ed82305bc (patch) | |
tree | 88a13218bf1113befc1670e131335bc15d8b7a7d /src | |
parent | ee6036e0321ecbb5c4b87fa4fd01942360fbbd18 (diff) | |
download | hdf5-15b28ad04ab6894cfd308d7855798b6ed82305bc.zip hdf5-15b28ad04ab6894cfd308d7855798b6ed82305bc.tar.gz hdf5-15b28ad04ab6894cfd308d7855798b6ed82305bc.tar.bz2 |
[svn-r13125] Description:
Add extra protection for sanity checks, when assertions are enabled.
Tested on:
Linux/32 2.6 (chicago)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FDlog.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5FDlog.c b/src/H5FDlog.c index c317355..06212e8 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -1161,8 +1161,10 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add assert(buf); /* Verify that we are writing out the type of data we allocated in this location */ - assert(type==H5FD_MEM_DEFAULT || type==(H5FD_mem_t)file->flavor[addr] || (H5FD_mem_t)file->flavor[addr]==H5FD_MEM_DEFAULT); - assert(type==H5FD_MEM_DEFAULT || type==(H5FD_mem_t)file->flavor[(addr+size)-1] || (H5FD_mem_t)file->flavor[(addr+size)-1]==H5FD_MEM_DEFAULT); + if(file->flavor) { + assert(type==H5FD_MEM_DEFAULT || type==(H5FD_mem_t)file->flavor[addr] || (H5FD_mem_t)file->flavor[addr]==H5FD_MEM_DEFAULT); + assert(type==H5FD_MEM_DEFAULT || type==(H5FD_mem_t)file->flavor[(addr+size)-1] || (H5FD_mem_t)file->flavor[(addr+size)-1]==H5FD_MEM_DEFAULT); + } /* end if */ /* Check for overflow conditions */ if (HADDR_UNDEF==addr) |