Skip to content

Unexpected verification result related to unsigned char calculation #3706

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

Closed
muchang opened this issue Jan 7, 2019 · 1 comment
Closed
Labels

Comments

@muchang
Copy link

muchang commented Jan 7, 2019

#include <assert.h>
unsigned char x = 50;
short y = -5;

int main ()
{
  x /= y;
  if (x != (unsigned char) -10)
    {assert(0); } 
return 0; }

CBMC version: 5.10
Operating system: Ubuntu 18.04
Exact command line resulting in the issue: cbmc <file.c>
What behaviour did you expect: Result in SUCCESS (proofed by compiling with gcc and Compcert)
What happened instead: [main.assertion.1] assertion 0: FAILURE

@kroening kroening added the bug label Jan 8, 2019
kroening pushed a commit that referenced this issue Jan 8, 2019
The C frontend needs to apply the usual arithmetic promotion rules in
compound assignments. Issue #3706.
@kroening
Copy link
Member

kroening commented Jan 8, 2019

Many thanks, test added.

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

No branches or pull requests

2 participants