This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 7487fade751a70fe58f5ba106abc4ed5ecda8a8e (commit)
from 461af9b3abd1aeb94f047f990074b7e5d954fbea (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7487fade751a70fe58f5ba106abc4ed5ecda8a8e
Author: NikLeberg <nik...@gm...>
Date: Mon Aug 11 13:19:08 2025 +0200
jtag/drivers/jtag_dpi: fix wraparound bug in runtest
Commit 0847a4d7fb98 ("jtag/commands: Use 'unsigned int' data type")
introduced bug when changing loop variable from `int` to `unsigned int`.
Instead of getting negative and terminating the loop, the value wraps
around to `INT_MAX` and the loop never finishes.
Change-Id: I055025a1f8eb4abe50955607b3e89530dfd92af4
Signed-off-by: NikLeberg <nik...@gm...>
Fixes: 0847a4d7fb98 ("jtag/commands: Use 'unsigned int' data type")
Reviewed-on: https://review.openocd.org/c/openocd/+/9078
Reviewed-by: Evgeniy Naydanov <eu...@gm...>
Reviewed-by: zapb <de...@za...>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/jtag/drivers/jtag_dpi.c b/src/jtag/drivers/jtag_dpi.c
index d6418d39c..35dd24507 100644
--- a/src/jtag/drivers/jtag_dpi.c
+++ b/src/jtag/drivers/jtag_dpi.c
@@ -189,7 +189,7 @@ static int jtag_dpi_runtest(unsigned int num_cycles)
return ERROR_FAIL;
}
snprintf(buf, sizeof(buf), "ib %d\n", num_bits);
- while (num_cycles > 0) {
+ for (unsigned int cycle = 0; cycle < num_cycles; cycle += num_bits + 6) {
ret = write_sock(buf, strlen(buf));
if (ret != ERROR_OK) {
LOG_ERROR("write_sock() fail, file %s, line %d",
@@ -208,8 +208,6 @@ static int jtag_dpi_runtest(unsigned int num_cycles)
__FILE__, __LINE__);
goto out;
}
-
- num_cycles -= num_bits + 6;
}
out:
-----------------------------------------------------------------------
Summary of changes:
src/jtag/drivers/jtag_dpi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|