-
-
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 'reinterpret' casts of StringExp to static array with implicit extension #9321
Conversation
Fixes issue 19639.
|
Thanks for your pull request and interest in making D better, @kinke! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#9321" |
| void main() | ||
| { | ||
| { | ||
| char[64] buf = EMPTY_STRING; |
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.
Currently segfaults the compiler (the EMPTY_STRING buffer (StringExp.string) as memcpy source is null).
| { | ||
| char[64] buf = SMALL_STRING; | ||
| assert(buf[0] == 'a'); | ||
| foreach (c; buf[1..$]) assert(c == 0); |
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.
Currently likely to fail or crash as the compile-time memcpy reads beyond the SMALL_STRING buffer.
|
This looks good but the PR can be submitted for the stable branch as it fixes a regression. |
|
I had it on stable and then switched to master, as I deemed it better suited (sooner in nightlies). It's a sort of regression - the crash for the first test block happens since v2.071, while the read-beyond-src-buffer has apparently been there since v2.068 (https://run.dlang.io/is/oPq799). Implicit extension was apparently added with v2.066. |
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.
all right, pink @thewilsonator
|
Hmm, the bugzilla issue wasn't auto-closed... |
The Bugzilla integration closes only things when they are merged in master automatically. Stable was turned off as too many people complained about lots of emails on new releases. Though IMHO that's a lot less worse than an integration which doesn't seem to work... |
|
@wilzbach: That's why I was wondering, this targeted master. |
|
Ah well, there's an explanation: https://developer.github.com/changes/2018-04-25-github-services-deprecation May 31, 2018: Submit your intentions for migrating or replacing your GitHub Service. |

Fixes issue 19639.