summaryrefslogtreecommitdiff
path: root/dbg_mlc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-08-31 20:00:33 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-08-31 20:00:33 +0300
commit0cfab104d2c03ce5461ac1f396c42c4cf747f64a (patch)
tree4ecb0679594ca5a031fee70be15950f6597b09ac /dbg_mlc.c
parentaf00c4da32c855867936409d920582cc773f0d01 (diff)
downloadbdwgc-0cfab104d2c03ce5461ac1f396c42c4cf747f64a.tar.gz
Workaround 'bad pointer arithmetic' false waring in check_annotated_obj
* dbg_mlc.c [!SHORT_DBG_HDRS] (GC_check_annotated_obj): Change (word*)ptr+ofs expressions to &((word*)ptr)[ofs].
Diffstat (limited to 'dbg_mlc.c')
-rw-r--r--dbg_mlc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dbg_mlc.c b/dbg_mlc.c
index af9652af..4d547c15 100644
--- a/dbg_mlc.c
+++ b/dbg_mlc.c
@@ -334,11 +334,11 @@ static void *store_debug_info(void *p, size_t lb,
return((ptr_t)(&(ohdr -> oh_sf)));
}
if (((word *)ohdr)[BYTES_TO_WORDS(gc_sz)-1] != (END_FLAG ^ (word)body)) {
- return((ptr_t)((word *)ohdr + BYTES_TO_WORDS(gc_sz)-1));
+ return (ptr_t)(&((word *)ohdr)[BYTES_TO_WORDS(gc_sz)-1]);
}
if (((word *)body)[SIMPLE_ROUNDED_UP_WORDS(ohdr -> oh_sz)]
!= (END_FLAG ^ (word)body)) {
- return((ptr_t)((word *)body + SIMPLE_ROUNDED_UP_WORDS(ohdr->oh_sz)));
+ return (ptr_t)(&((word *)body)[SIMPLE_ROUNDED_UP_WORDS(ohdr->oh_sz)]);
}
return(0);
}