* [binutils-gdb] gprofng: Fix -Wsign-compare warning
@ 2023-05-31 18:51 Vladimir Mezentsev
0 siblings, 0 replies; only message in thread
From: Vladimir Mezentsev @ 2023-05-31 18:51 UTC (permalink / raw)
To: bfd-cvs, gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=dd8a4e320b34ab24d4f6433ad1698d6b6cb68969
commit dd8a4e320b34ab24d4f6433ad1698d6b6cb68969
Author: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Date: Thu May 25 19:06:52 2023 -0700
gprofng: Fix -Wsign-compare warning
gprofng/ChangeLog
2023-05-25 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR gprofng/30490
* src/LoadObject.cc: Fix -Wsign-compare warning.
Diff:
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-31 18:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-31 18:51 [binutils-gdb] 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).