Skip to content

Commit 9d06375

Browse files
committed
fixed for loops with unsigned variables
1 parent 1d067f1 commit 9d06375

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

loops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,12 +799,12 @@ AST *GetRevisedLimit(int updateTestOp, AST *oldLimit)
799799
{
800800
if (IsConstExpr(oldLimit) || IsIdentifier(oldLimit)) {
801801
// a constant expression is always good
802-
if (updateTestOp == K_LE) {
802+
if (updateTestOp == K_LE || updateTestOp == K_LEU) {
803803
oldLimit = AstOperator('+', oldLimit, AstInteger(1));
804804
}
805805
return oldLimit;
806806
}
807-
if (updateTestOp != K_LE) {
807+
if (updateTestOp != K_LE && updateTestOp != K_LEU) {
808808
return NULL;
809809
}
810810
// only accept very simple expressions

0 commit comments

Comments
 (0)