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

Inconsistent typecasting and shift operation result #4584

Open
yangzao opened this issue Apr 17, 2024 · 0 comments
Open

Inconsistent typecasting and shift operation result #4584

yangzao opened this issue Apr 17, 2024 · 0 comments
Labels
bug Something is broken needs-triage Issue has yet to be looked at by a maintainer

Comments

@yangzao
Copy link

yangzao commented Apr 17, 2024

Description

Original code:

`321 + 42 - ((int)((((double)(321)) - ((double)(321))))) + ((int)((((int)(321)) << ((int)(321)))))`

Clang consider this operation result to be 28690.
Decompiled value:

8210

Steps to reproduce the bug

Files:
3.zip

  1. compile orig.c with Clang and -O0.
  2. decompile the compiled program with angr.
  3. in the decompiled code, the issue is at v5 = v8; in the first for loop. v8 (initialized to 8210) corresponds to the above-mentioned operation.

Environment

No response

Additional context

No response

@yangzao yangzao added bug Something is broken needs-triage Issue has yet to be looked at by a maintainer labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken needs-triage Issue has yet to be looked at by a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant