Skip to content

Unwound SSA has incorrect guards for return from loop body #101

Open
@peterschrammel

Description

@peterschrammel

Example:

extern void __VERIFIER_error() __attribute__ ((__noreturn__));
void __VERIFIER_assert(int cond) { if(!(cond)) { ERROR: __VERIFIER_error(); } }
#define SIZE 1
int _strcmp( int src[SIZE] , int dst[SIZE] ) {
  int i = 0;
  while ( i < SIZE ) {
    int k=src[i];
    int l=dst[i];
    if( k != l ) return 1;
    i = i + 1;
  }
  return 0;
}
int main( ) {
  int a[SIZE];
  int b[SIZE];
  int c = _strcmp( a , b );
  if ( c == 0 ) {
    int x;
    for ( x = 0 ; x < SIZE ; x++ ) {
      int m=a[x];
      int n=b[x];
      __VERIFIER_assert( m == n );
    }
  }
  return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions