From: Augustin Degomme Date: Mon, 23 Aug 2021 18:53:54 +0000 (+0200) Subject: Fix for clang 14: new check was added against substracting from a potential nullptr. X-Git-Tag: v3.29~126^2~6 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1c67b1098855cd6e7782c8379cfe27fc310144eb Fix for clang 14: new check was added against substracting from a potential nullptr. --- diff --git a/src/mc/remote/AppSide.cpp b/src/mc/remote/AppSide.cpp index 2938475731..eeee309243 100644 --- a/src/mc/remote/AppSide.cpp +++ b/src/mc/remote/AppSide.cpp @@ -256,7 +256,7 @@ void AppSide::ignore_heap(void* address, std::size_t size) const message.fragment = -1; heap->heapinfo[message.block].busy_block.ignore++; } else { - message.fragment = (ADDR2UINT(address) % BLOCKSIZE) >> heap->heapinfo[message.block].type; + message.fragment = address ? (ADDR2UINT(address) % BLOCKSIZE) >> heap->heapinfo[message.block].type : 0; heap->heapinfo[message.block].busy_frag.ignore[message.fragment]++; }