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

structs with non 32bit width #9

Open
kren1 opened this issue Jan 22, 2017 · 0 comments
Open

structs with non 32bit width #9

kren1 opened this issue Jan 22, 2017 · 0 comments

Comments

@kren1
Copy link
Contributor

kren1 commented Jan 22, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant