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

Undefined behaviour #67

Open
dirkwhoffmann opened this issue Jan 10, 2020 · 0 comments
Open

Undefined behaviour #67

dirkwhoffmann opened this issue Jan 10, 2020 · 0 comments

Comments

@dirkwhoffmann
Copy link

Under some circumstances, Musashi uses too large bit-shift values. This results in undefined behaviour.

This is what the UndefinedBehaviorSanitizer (which is part of clang) reports:

Bildschirmfoto 2020-01-10 um 18 33 03

Bildschirmfoto 2020-01-10 um 18 33 39

Bildschirmfoto 2020-01-10 um 18 34 27

The problem with undefined behaviour shouldn't be underestimated, because some modern compilers (such as clang) make use of it to aggressively optimise code. Code with undefined behaviour can behave differently when compiled with "clang -O0" or "clang -O1", respectively (even on the same machine).

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