[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.]
This commit is contained in:
Pedro Vicente Nunes 2002-09-21 18:20:00 -05:00
parent 5487187a93
commit 47fc490832
2 changed files with 21 additions and 7 deletions

View File

@ -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.

View File

@ -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);