Bug 15524 – [REG2.069] 64bit app with anon-class crashes in contract

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2016-01-07T07:09:00Z
Last change time
2016-02-24T02:55:27Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
jiki

Comments

Comment #0 by jiki — 2016-01-07T07:09:07Z
This reduced code works in 2.068.2, but the program crashes in 2.069 and 2.070beta1. I tested with Win7 64bit. rdmd -m64 test.d --------------------------------- void main(string[] args) { auto t = new Test(); t.add("first"); t.add("second"); } class Test { int[string] infos; void add(string key) in { assert(key !in infos); // @@@ crash here at second } body { auto item = new class { void notCalled() { infos[key] = 0; // affects? } }; //dummy ~= item; // does not affect infos[key] = 0; } } Object[] dummy; ---------------------------------
Comment #1 by k.hara.pg — 2016-02-07T01:22:47Z
Comment #2 by k.hara.pg — 2016-02-14T06:25:43Z
Comment #3 by github-bugzilla — 2016-02-23T08:52:58Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/aaa3b7a205e0f92456ba96865fcdae8f770c8b7b fix Issue 15524 - 64bit app with anon-class crashes in contract The regression has been introduce by issue 9383 fix (PR #4788). In Win64, some function parameters are passed by registers (`SCshadowreg`). When the parameters are placed in closure context, their access was not well handled in #4788. Also in Posix 64bit platforms, parameter variables have SCauto. So there was same issue. https://github.com/D-Programming-Language/dmd/commit/ea553ad9ed1053db4348bda584df5380bf6d0eea Merge pull request #5420 from 9rnsr/fix15524 [REG2.069] Issue 15524 - 64bit app with anon-class crashes in contract
Comment #4 by github-bugzilla — 2016-02-24T02:55:27Z