From dd8a4e320b34ab24d4f6433ad1698d6b6cb68969 Mon Sep 17 00:00:00 2001 From: Vladimir Mezentsev Date: Thu, 25 May 2023 19:06:52 -0700 Subject: gprofng: Fix -Wsign-compare warning gprofng/ChangeLog 2023-05-25 Vladimir Mezentsev PR gprofng/30490 * src/LoadObject.cc: Fix -Wsign-compare warning. --- gprofng/src/LoadObject.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gprofng') diff --git a/gprofng/src/LoadObject.cc b/gprofng/src/LoadObject.cc index 9601dee..76dba3e 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 -- cgit v1.1