Fix ranges (C modulo can be negative)

This commit is contained in:
Alex Groce
2018-12-09 11:34:47 -07:00
committed by GitHub
parent 375659421d
commit 19b606be8e
+1 -1
View File
@@ -272,7 +272,7 @@ DEEPSTATE_INLINE static void DeepState_Check(int expr) {
} \
if ((x < low) || (x > high)) { \
const tname size = (high - low) + 1; \
return low + (x % size); \
return low + ((x % size + size) % size); \
} \
return x; \
}