From: Vladimir Mezentsev Date: Fri, 26 May 2023 02:06:52 +0000 (-0700) Subject: gprofng: Fix -Wsign-compare warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd8a4e320b34ab24d4f6433ad1698d6b6cb68969;p=binutils-gdb.git gprofng: Fix -Wsign-compare warning gprofng/ChangeLog 2023-05-25 Vladimir Mezentsev PR gprofng/30490 * src/LoadObject.cc: Fix -Wsign-compare warning. --- diff --git a/gprofng/src/LoadObject.cc b/gprofng/src/LoadObject.cc index 9601dee7bd9..76dba3e811e 100644 --- a/gprofng/src/LoadObject.cc +++ b/gprofng/src/LoadObject.cc @@ -463,7 +463,8 @@ LoadObject::find_function (uint64_t foff) { // Function is already created func = fp; - if (func->size < foff - func->img_offset) + uint64_t sz = func->size < 0 ? 0 : func->size; + if (sz + func->img_offset < foff) func->size = foff - func->img_offset; } else