-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
fix Issue 7997 - Optlink issues 'Index Range' error with static zero … #7243
Conversation
|
Thanks for your pull request, @WalterBright! Bugzilla references
|
| { | ||
| /* Give it a byte of data | ||
| * so we can take the 'address' of this symbol | ||
| * and avoid problematic behavior of object file format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid problematic behavior of object file format
Isn't this more Optlink incorrectly handling the object file format than an error in the object file format. A patch should be made to fix Optlink instead of creating a workaround for it here, with a vague comment that doesn't mention what it actually is: an Optlink bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optlink is much more difficult to look into so I'll take this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar problems happen with other object file formats.
I'm not sure one could call it a 'bug' in the file format anyway. What does it mean to take the address of a 0 length object? Should the object file format decide that?
A similar thing happens with empty C++ structs:
struct S { };
S* p = new S();
What happens? Weird problems can arise, so the standard devised a simple solution - it gives it a size of 1. The problems go away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume the coverage issues are not unexpected.
|
Coverage testing is done on Linux, so OSX specific code isn't covered. |
…length array