Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[pvs] Possible overflow. Cast operands of the '1 << type' operator to the 'size_t...
[simgrid.git] / src / xbt / mmalloc / mrealloc.c
index 9e9a877..1bdd724 100644 (file)
@@ -129,7 +129,7 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
       abort();
     }
 
-    if (size > (size_t) (1 << (type - 1)) && size <= (size_t) (1 << type)) {
+    if (size > ((size_t)1 << (type - 1)) && size <= ((size_t)1 << type)) {
       /* The new size is the same kind of fragment.  */
 
       result = ptr;