crest icon indicating copy to clipboard operation
crest copied to clipboard

structs with non 32bit width

Open kren1 opened this issue 8 years ago • 0 comments

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.

kren1 avatar Jan 22 '17 18:01 kren1