summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-05-26 17:32:49 +0700
committerhathach <[email protected]>2021-05-26 17:32:49 +0700
commitdbef50f8ffb6892297456aeb409f3d52d3731f0a (patch)
treeccdc55b79f09fac955fcca7bb93b2ff74511d299 /src/common
parentce59d69520166b37869cf83a3dab929c1b2c4ac4 (diff)
parent220f4410485a84a4e5e8f2a68e03dd8ed3b93900 (diff)
Merge branch 'master' into xmos-jmccarthy-master
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_fifo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/tusb_fifo.c b/src/common/tusb_fifo.c
index 81e11eb01..5f7b6a26d 100644
--- a/src/common/tusb_fifo.c
+++ b/src/common/tusb_fifo.c
@@ -325,6 +325,8 @@ static uint16_t advance_pointer(tu_fifo_t* f, uint16_t p, uint16_t offset)
// We limit the index space of p such that a correct wrap around happens
// Check for a wrap around or if we are in unused index space - This has to be checked first!!
// We are exploiting the wrap around to the correct index
+
+ // TODO warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
if ((p > p + offset) || (p + offset > f->max_pointer_idx))
{
p = (p + offset) + f->non_used_index_space;