Showing error 1454

User: Jiri Slaby
Error type: Reachable Error Location
Error type description: A specified error location is reachable in some program path
File location: list-properties/simple_safe.i
Line in file: 642
Project: SV-COMP 2013
Project version: 2.6.28
Tools: Manual Work
Entered: 2013-01-17 16:57:54 UTC


Source:

612        char *__const *__restrict __tokens,
613        char **__restrict __valuep)
614     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
615extern int getloadavg (double __loadavg[], int __nelem)
616     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
617
618void exit(int s) {
619 _EXIT: goto _EXIT;
620}
621typedef struct node {
622  int h;
623  struct node *n;
624} *List;
625int main() {
626  List a = (List) malloc(sizeof(struct node));
627  if (a == 0) exit(1);
628  List t;
629  List p = a;
630  while (__VERIFIER_nondet_int()) {
631    p->h = 1;
632    t = (List) malloc(sizeof(struct node));
633    if (t == 0) exit(1);
634    p->n = t;
635    p = p->n;
636  }
637  p->h = 1;
638  p->n = 0;
639  p = a;
640  while (p!=0) {
641    if (p->h != 1) {
642      ERROR: goto ERROR;
643    }
644    p = p->n;
645  }
646  return 0;
647}
Show full sources