D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4189 - Bus errors with array operations
Summary: Bus errors with array operations
Status: RESOLVED DUPLICATE of issue 3658
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Mac OS X
: P2 normal
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2010-05-14 18:35 UTC by Matt Pillsbury
Modified: 2015-06-09 05:13 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Matt Pillsbury 2010-05-14 18:35:49 UTC
Using an arithmetic operations on arrays causes bus errors when compiling with DMD 2.046 on Mac OS 10.6.3.

void main ()
{
  auto vec = new double[10];

  foreach(i, ref x; vec) { x = cast(double) i; }

  vec[] *= 0.5; 
}

This compiles with no errors or warnings, and a bus error results when the resulting binary is executed.
Comment 1 Don 2010-06-09 11:50:32 UTC

*** This issue has been marked as a duplicate of issue 3658 ***