]> git.sur5r.net Git - openocd/commit
target/cortex_m: avoid dwt comparator overflow
authorCody P Schafer <openocd@codyps.com>
Wed, 7 Mar 2018 16:31:35 +0000 (11:31 -0500)
committerTomas Vanek <vanekt@fbl.cz>
Wed, 4 Apr 2018 20:24:53 +0000 (21:24 +0100)
commita28dea0fe429339e4f8d356fbff19cb17350c9ca
treeba49d848dd6a75df800a045cf74a6cc60502fd80
parent6e6f90d1af601af0f6079f19f603a9a3a6e83da1
target/cortex_m: avoid dwt comparator overflow

Avoid ever overflowing the DWT_COMPARATOR array by allocating space for
16 comparators (the field is masked by 0xf).

On a stm32f767zi chip (on a nucleo-767zi board) I've been seeing crashes
with address sanitizer enabled due to its (apparent) 10 present
comparators. This appears to be due to
https://sourceforge.net/p/openocd/tickets/178/.

In non-address sanitizer builds, this would likely cause some random
memory to be written to in some cases. (see above bug for observations).

Change-Id: I2b7d599eb326236dbc93f74b350c442c9a502c4b
Signed-off-by: Cody P Schafer <openocd@codyps.com>
Reviewed-on: http://openocd.zylin.com/4458
Tested-by: jenkins
Reviewed-by: Christopher Head <chead@zaber.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/target/cortex_m.c