Skip to content

Commit

Permalink
Fix infinite loop in wait
Browse files Browse the repository at this point in the history
When it runs into this branch, n never increases and the ports never
changes.
  • Loading branch information
zsx committed Jan 20, 2014
1 parent ffa0d89 commit 2b7516e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/c-port.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,9 @@ xx*/ REBINT Wait_Device(REBREQ *req, REBCNT timeout)
for (n = 0; n < SERIES_TAIL(ports);) {
val = BLK_SKIP(ports, n);
if (IS_PORT(val)) {
if (VAL_TAIL(waked) != Find_Block_Simple(VAL_SERIES(waked), 0, val)) {
Remove_Series(VAL_SERIES(waked), n, 1);
if (VAL_TAIL(waked) != 0
&& VAL_TAIL(waked) == Find_Block_Simple(VAL_SERIES(waked), 0, val)) {//not found
Remove_Series(ports, n, 1);
continue;
}
}
Expand Down

0 comments on commit 2b7516e

Please sign in to comment.