* [PATCH] gprofng: Fix -Wsign-compare warning
@ 2023-05-26 19:55 vladimir.mezentsev
0 siblings, 0 replies; only message in thread
From: vladimir.mezentsev @ 2023-05-26 19:55 UTC (permalink / raw)
To: binutils; +Cc: Vladimir Mezentsev
From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
gprofng/ChangeLog
2023-05-25 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR gprofng/30490
* src/LoadObject.cc: Fix -Wsign-compare warning.
---
gprofng/src/LoadObject.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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
--
2.31.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-26 19:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-26 19:55 [PATCH] gprofng: Fix -Wsign-compare warning vladimir.mezentsev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).