D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2549 - Segfault on array multiplication.
Summary: Segfault on array multiplication.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: patch, wrong-code
Depends on:
Blocks:
 
Reported: 2008-12-30 16:43 UTC by David Simcha
Modified: 2015-06-09 01:20 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description David Simcha 2008-12-30 16:43:42 UTC
import std.stdio;

void main() {
    double[] foo = [1.0,2,3,4,5].dup;
    writeln(foo[] * 2.0);

}

Output of this program on Win32:

object.Error: Access Violation
[
Comment 1 Trass3r 2010-01-17 17:28:45 UTC
Also note the following:

float[] a = [0.f, 0.5f, 1.0f, 1.5f, 2.0f, 2.5f];
float[] b = [0.f, 0.5f, 1.0f, 1.5f, 2.0f, 2.5f];

writeln(a[] * b[]); // compiles, but results in access violation
writeln(a[] + b[]); // array operation a[] + b[] not implemented


This bug also is in relation to
http://d.puremagic.com/issues/show_bug.cgi?id=3066
Comment 2 Don 2010-04-28 21:20:06 UTC
The patch for bug 3522 fixes this.
Comment 3 Walter Bright 2010-04-29 21:05:47 UTC
Changeset 460
Comment 4 Don 2010-05-05 19:05:22 UTC
Fixed DMD2.044