Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
peterschrammel opened this issue Dec 30, 2017 · 0 comments
Open

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

peterschrammel opened this issue Dec 30, 2017 · 0 comments

Comments

@peterschrammel
Copy link
Member

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;
}
@peterschrammel peterschrammel changed the title SSA has incorrect guards for return from loop body Unwound SSA has incorrect guards for return from loop body Dec 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant