jburnim / crest

CREST is a concolic test generation tool for C.
http://jburnim.github.io/crest/
BSD 2-Clause "Simplified" License
158 stars 50 forks source link

structs with non 32bit width #9

Open kren1 opened 7 years ago

kren1 commented 7 years ago

I think I found another issue with crest when dealing with bit fields.

Given a program like:

struct {
  unsigned a : 16;
} b = {1};
int d;

int main() {
  if (b.a < -1) {
    d = 9;
  }
  printf("d: %d\n",d);
}

Crest outputs d: 9, while the correct output should clearly be d: 0. Interestingly if the width of a is changed to 32, the bug disappears. Any other width but 32, shows the error.