D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3287 - DANGER!! Generating wrong binaries by initializing of between different type structs
Summary: DANGER!! Generating wrong binaries by initializing of between different type ...
Status: RESOLVED DUPLICATE of issue 2469
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P1 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid, wrong-code
Depends on:
Blocks:
 
Reported: 2009-09-03 09:08 UTC by Haruki Shigemori
Modified: 2015-06-09 01:26 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Haruki Shigemori 2009-09-03 09:08:17 UTC
import std.stdio;
struct X
{
	int a;
}
struct Y
{
	string b;
}
void main()
{
	Y v = X(10000);
	writeln(v.b);
}

// DANGER!! crash on running!!
Comment 1 Jarrett Billingsley 2009-09-03 09:48:19 UTC

*** This issue has been marked as a duplicate of issue 2469 ***
Comment 2 Haruki Shigemori 2009-09-03 11:39:55 UTC
Oh, sorry!
I forgot the first commit.
This is the second commit about the same issue.