Skip to content

Commit

Permalink
Use rand() in 77/10
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstanb committed Oct 4, 2023
1 parent 3341470 commit 1211a9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/regression/77-mem-oob/10-oob-two-loops.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
// PARAM: --set ana.activated[+] memOutOfBounds --enable ana.int.interval --disable warn.info --set sem.int.signed_overflow assume_none
#include <stdlib.h>

int main() {
int *p = malloc(1048 * sizeof(int));

for (int i = 0; i < 1048; ++i) {
p[i] = __VERIFIER_nondet_int(); //NOWARN
p[i] = rand(); //NOWARN
}

int *q = p;

while (*q >= 0 && q < p + 1048 * sizeof(int)) { //WARN
if (__VERIFIER_nondet_int()) {
if (rand()) {
q++;
} else {
(*q)--; //WARN
Expand Down

0 comments on commit 1211a9f

Please sign in to comment.