summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2002-09-21 23:20:00 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2002-09-21 23:20:00 (GMT)
commit47fc4908325071261476bbdabb1be696323f9298 (patch)
treec9f56c9ea0c0f0f9ad13132fc16e3fe59d51418e /src/H5T.c
parent5487187a931fbe9f56634634188e6df9663b54b6 (diff)
downloadhdf5-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.]
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 30cc573..0218342 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -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);