summaryrefslogtreecommitdiffstats
path: root/src/H5VMprivate.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5VMprivate.h')
-rw-r--r--src/H5VMprivate.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h
index 4d71b29..decac7e 100644
--- a/src/H5VMprivate.h
+++ b/src/H5VMprivate.h
@@ -460,7 +460,11 @@ H5VM_power2up(hsize_t n)
{
hsize_t ret_value = 1; /* Return value */
- while(ret_value < n)
+ /* Returns 0 when n exceeds 2^63 */
+ if(n >= (hsize_t)1 << ((sizeof(hsize_t) * CHAR_BIT) - 1))
+ ret_value = 0;
+
+ while(ret_value && ret_value < n)
ret_value <<= 1;
return(ret_value);