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

Remove undefined behavior from test23. #1966

Merged
merged 1 commit into from May 7, 2013
Merged

Conversation

dnadlinger
Copy link
Member

The code tried to load 4 bytes from an 1-3 byte allocation.
LLVM's optimizer actually detects this, marking the entire
result undefined.

@yebblies
Copy link
Member

yebblies commented May 5, 2013

Could you cast but not dereference instead of killing those old tests?

@donc
Copy link
Collaborator

donc commented May 5, 2013

The bug being tested is bug 407, and it was a DMD segfault. Perhaps this undefined behaviour could be detected in the front-end? Maybe worth opening a new bug report for that.

@yebblies
Copy link
Member

yebblies commented May 5, 2013

@klickverbot
It would be good to add a comment now that Don has identified it as bug 407.
@donc
I don't see how we could do that, it's still valid @system D code.

The code tried to load 4 bytes from an 1-3 byte allocation.
LLVM's optimizer actually detects this, marking the entire
result undefined.
@dnadlinger
Copy link
Member Author

Added a reference to the Bugzilla issue.

@yebblies: It's probably not valid under a straightforward interpretation of the C memory model (may only access memory from the allocation a pointer is based on).

yebblies added a commit that referenced this pull request May 7, 2013
Remove undefined behavior from test23.
@yebblies yebblies merged commit 11c01fe into dlang:master May 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants