summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index cca36bc..140a52d 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -96,6 +96,12 @@ H5AC_dest (hdf5_file_t *f)
*
* Modifications:
*
+ * Robb Matzke, 4 Aug 1997
+ * Fails immediately if the cached object is at the correct address
+ * but is of the wrong type. This happens if the caller doesn't know
+ * what type of object is at the address and calls this function with
+ * various type identifiers until one succeeds (cf., the debugger).
+ *
*-------------------------------------------------------------------------
*/
void *
@@ -119,6 +125,15 @@ H5AC_find (hdf5_file_t *f, const H5AC_class_t *type, haddr_t addr,
}
/*
+ * Fail if the item in the cache is at the correct address but is
+ * of the wrong type.
+ */
+ if (f->cache[idx].type && f->cache[idx].addr==addr &&
+ f->cache[idx].type!=type) {
+ return NULL;
+ }
+
+ /*
* Load a new thing. If it can't be loaded, then return an error
* without preempting anything.
*/