diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2002-09-21 23:20:00 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2002-09-21 23:20:00 (GMT) |
commit | 47fc4908325071261476bbdabb1be696323f9298 (patch) | |
tree | c9f56c9ea0c0f0f9ad13132fc16e3fe59d51418e | |
parent | 5487187a931fbe9f56634634188e6df9663b54b6 (diff) | |
download | hdf5-47fc4908325071261476bbdabb1be696323f9298.zip hdf5-47fc4908325071261476bbdabb1be696323f9298.tar.gz hdf5-47fc4908325071261476bbdabb1be696323f9298.tar.bz2 |
[svn-r5936]
Purpose:
bug fix
[ i s this a bug fix? feature? ...]
Description:
the copy of a symbol table entry was done with a shallow copy, in H5T_copy
this was causing an exception on the free call of the ID to name buffer
replaced a shallow copy of a symbo l a edescribe the bug, or describe the new feature, etc]
Solution:
[details about the changes, algorithm, etc...]
[Please as detail as you can since your own explanation is
better than others guessing it from the code.]
Platforms tested:
windows 2000
solaris with cpp, fortran
irix64, with fortran, parallel i r
[machines you have tested the changed version. This is absolute
important. Test it out on at least two or three different platforms
such as Big-endian-32bit (SUN/IRIX), little-endian-32(LINUX) and
64-bit (IRIX64/UNICOS/DEC-ALPHA) would be good.]
-rw-r--r-- | src/H5G.c | 6 | ||||
-rw-r--r-- | src/H5T.c | 22 |
2 files changed, 21 insertions, 7 deletions
@@ -79,6 +79,7 @@ #define H5F_PACKAGE /*suppress error about including H5Fpkg */ + /* Packages needed by this file... */ #include "H5private.h" #include "H5Aprivate.h" @@ -1063,8 +1064,7 @@ H5G_namei(H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/, int _nlinks = H5G_NLINKS; const char *s = NULL; herr_t ret_value=SUCCEED; - - + H5G_t *tmp_grp; const char *orig_name = name; unsigned int null_obj = obj_ent == NULL ? 1 : 0; @@ -1148,7 +1148,7 @@ H5G_namei(H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/, /* Set flag if at least one component was found */ found_once =1; - if (H5G_stab_find(grp_ent, H5G_comp_g, /*&tmp_obj_ent*/ obj_ent/*out*/ )<0) { + if (H5G_stab_find(grp_ent, H5G_comp_g, obj_ent/*out*/ )<0) { /* * Component was not found in the current symbol table, possibly * because GRP_ENT isn't a symbol table. @@ -5360,8 +5360,8 @@ H5T_open_oid (H5G_entry_t *ent) /* Mark the type as named and open */ dt->state = H5T_STATE_OPEN; - dt->ent = *ent; - + dt->ent = *ent; + /* Set return value */ ret_value=dt; @@ -5406,6 +5406,8 @@ done: * Robb Matzke, 20 May 1999 * Now able to copy opaque types. * + * Pedro Vicente, <pvn@ncsa.uiuc.edu> 21 Sep 2002 + * Added a deep copy of the symbol table entry * *------------------------------------------------------------------------- */ @@ -5427,8 +5429,8 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); /* Copy actual information */ - *new_dt = *old_dt; - + *new_dt = *old_dt; + /* Copy parent information */ if (new_dt->parent) new_dt->parent = H5T_copy(new_dt->parent, method); @@ -5574,6 +5576,11 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) break; } /* end switch */ + + /*deep copy of the symbol table entry*/ + if (H5G_ent_copy(&(old_dt->ent),&(new_dt->ent))<0) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to copy entry"); + /* Set return value */ ret_value=new_dt; @@ -5718,6 +5725,10 @@ done: * * Robb Matzke, 1999-05-20 * Closes opaque types also. + * + * Pedro Vicente, <pvn@ncsa.uiuc.edu> 22 Aug 2002 + * Added "ID to name" support + * *------------------------------------------------------------------------- */ herr_t @@ -5772,6 +5783,9 @@ H5T_close(H5T_t *dt) break; } + /*Free the ID to name buffer */ + H5G_free_ent_name(&(dt->ent)); + /* Free the datatype struct */ H5FL_FREE(H5T_t,dt); |