On 10/28/2012 11:38 AM, Dan wrote:
> I'm having a crash I've been unable to figure out. I have a small pretty
> print function that so far has handled most of my needs. However while
> debugging I threw something at it that caused a crash, so I know it must
> have an issue.
> The portion calling out to pp is
> ---
> double getRate(double taxableGrossIncome) const {
> auto sortedRange = assumeSorted(_table[]);
> auto needle = KeyValuePair(taxableGrossIncome, 0);
> auto found = sortedRange.lowerBound(needle);
> if(!found.empty) {
> writeln(pp(found)); // fine
> writeln(pp(found), taxableGrossIncome); // fine
> writeln(taxableGrossIncome, pp(found)); // crash
> return found[$-1][1];
> }
> return 0;
> }
> ---

[...]

> The single file with main causing the crash is at:
> http://pastebin.com/M67PamQM

First, in order to build the code with dmd 2.060, I had to make opEquals() and getRate() non-const.

I was able to reproduce the problem in my 64-bit environment.

The workaround is to compile with -m32. It worked for me.

There are some 64-bit compilation bugs. Please create a bug report if you don't think this has already been reported:

  http://d.puremagic.com/issues/

Ali

Reply via email to