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

Issue 7942 - Appending different string types corrupts memory #3966

Merged
1 commit merged into from Sep 10, 2014

Conversation

yebblies
Copy link
Member

@yebblies yebblies commented Sep 9, 2014

@@ -284,7 +284,7 @@ void test24()
{
wchar[] r;

r ~= "\000";
r ~= "\000"w;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah but wait, shouldn't we support this for literals without creating performance costs? It would be convenient.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could... It doesn't work at the moment though.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok then, it's better to completely disallow it then to continue doing the wrong thing. Maybe we should just file an enhancement request to avoid forgetting about it.

@ghost
Copy link

ghost commented Sep 10, 2014

Auto-merge toggled on

@yebblies
Copy link
Member Author

Thanks, I'll open an enhancement. It probably should work at least for un-suffixed strings.

@yebblies
Copy link
Member Author

Enhancement opened

@ghost
Copy link

ghost commented Sep 10, 2014

Thanks.

ghost pushed a commit that referenced this pull request Sep 10, 2014
Issue 7942 - Appending different string types corrupts memory
@ghost ghost merged commit aad21a5 into dlang:master Sep 10, 2014
@yebblies yebblies deleted the issue7942 branch September 10, 2014 11:40
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant