summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2019-12-06 19:35:55 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2019-12-06 19:35:55 (GMT)
commit17b8281ce469e58ec597156e0017ff61a0d7a566 (patch)
tree1cb5f9f5bdcc09702523fb66e7dfbb638a7d991c
parente1136858f9f833738e03e34f3948a51720cdbd13 (diff)
parent0f1be317c37ca04db263680e6f1fe4d97b937b39 (diff)
downloadhdf5-17b8281ce469e58ec597156e0017ff61a0d7a566.zip
hdf5-17b8281ce469e58ec597156e0017ff61a0d7a566.tar.gz
hdf5-17b8281ce469e58ec597156e0017ff61a0d7a566.tar.bz2
Merge pull request #2080 in HDFFV/hdf5 from ~VCHOI/my_third_fork:bugfix/112_hyper_ver to hdf5_1_12
* commit '0f1be317c37ca04db263680e6f1fe4d97b937b39': More fixes for the PR: (1) Set the version for reference datatype message to H5O_DTYPE_VERSION_4. (2) The tests for the new reference types should work for V112 and beyond. Verify the decoded version for hyperslab selection.
-rw-r--r--src/H5Shyper.c3
-rw-r--r--src/H5Spkg.h7
-rw-r--r--src/H5T.c1
-rw-r--r--test/trefer.c2
4 files changed, 9 insertions, 4 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 5147289..e9a7133 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -4250,6 +4250,9 @@ H5S__hyper_deserialize(H5S_t **space, const uint8_t **p)
/* Decode version */
UINT32DECODE(pp, version);
+ if(version < H5S_HYPER_VERSION_1 || version > H5S_HYPER_VERSION_LATEST)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for hyperslab selection")
+
if(version >= (uint32_t)H5S_HYPER_VERSION_2) {
/* Decode flags */
flags = *(pp)++;
diff --git a/src/H5Spkg.h b/src/H5Spkg.h
index 278f08d..6a78e52 100644
--- a/src/H5Spkg.h
+++ b/src/H5Spkg.h
@@ -41,9 +41,10 @@
#define H5S_SELECT_FLAG_BITS (H5S_HYPER_REGULAR)
/* Versions for H5S_SEL_HYPER selection info */
-#define H5S_HYPER_VERSION_1 1
-#define H5S_HYPER_VERSION_2 2
-#define H5S_HYPER_VERSION_3 3
+#define H5S_HYPER_VERSION_1 1
+#define H5S_HYPER_VERSION_2 2
+#define H5S_HYPER_VERSION_3 3
+#define H5S_HYPER_VERSION_LATEST H5S_HYPER_VERSION_3
/* Versions for H5S_SEL_POINTS selection info */
#define H5S_POINT_VERSION_1 1
diff --git a/src/H5T.c b/src/H5T.c
index 43dfef8..f2d6c70 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -254,6 +254,7 @@
dt->shared->u.atomic.u.r.rtype = H5R_OBJECT2; \
dt->shared->u.atomic.u.r.opaque = TRUE; \
dt->shared->u.atomic.u.r.version = H5R_ENCODE_VERSION; \
+ dt->shared->version = H5O_DTYPE_VERSION_4; \
}
/* Define the code templates for the "SIZE_TMPL" in the H5T_INIT_TYPE macro */
diff --git a/test/trefer.c b/test/trefer.c
index 7ab3bd4..0fce2a3 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -2811,7 +2811,7 @@ test_reference(void)
for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
/* Invalid combinations, just continue */
- if(high == H5F_LIBVER_EARLIEST || high < low)
+ if(high <= H5F_LIBVER_V110 || high < low)
continue;
test_reference_region(low, high); /* Test basic H5R dataset region reference code */