From 8413ef57988e653dd7731e897dd7295aad9e26c6 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Thu, 20 Apr 2017 21:01:59 +0000 Subject: [PATCH] libthread_db: unbreak build due to sign/unsigned comparison. Reported by: lwshu --- lib/libthread_db/libpthread_db.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libthread_db/libpthread_db.c b/lib/libthread_db/libpthread_db.c index 55fef7128e40..49dd98f64aae 100644 --- a/lib/libthread_db/libpthread_db.c +++ b/lib/libthread_db/libpthread_db.c @@ -227,7 +227,7 @@ pt_ta_map_id2thr(const td_thragent_t *ta, thread_t id, td_thrhandle_t *th) TDBG_FUNC(); - if (id < 0 || id >= ta->map_len || ta->map[id].type == PT_NONE) + if (id < 0 || id >= (long)ta->map_len || ta->map[id].type == PT_NONE) return (TD_NOTHR); ret = thr_pread_ptr(ta, ta->thread_list_addr, &pt); @@ -1062,7 +1062,7 @@ static int pt_validate(const td_thrhandle_t *th) { - if (th->th_tid < 0 || th->th_tid >= th->th_ta->map_len || + if (th->th_tid < 0 || th->th_tid >= (long)th->th_ta->map_len || th->th_ta->map[th->th_tid].type == PT_NONE) return (TD_NOTHR); return (TD_OK);