← Back to index
|
Original Bugzilla link
Bug 8292 – segfaults on out contract
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-24T12:24:00Z
Last change time
2013-10-06T23:23:41Z
Keywords
ice
Assigned to
nobody
Creator
tobias
Comments
Comment #0
by tobias — 2012-06-24T12:24:26Z
dmd segfault.d segfaults, if segfault.d contains -- module sat; import std.container; struct Literal { Var var; bool sign; } struct Var { size_t idx; alias idx this; } struct Clause { Literal[] literals; alias literals this; } struct Watchers { Array!(Array!(Clause*)*) watchlist; alias watchlist this; Array!(Clause*)* opIndex(Literal lit) { return watchlist[index(lit)]; } size_t index(Literal lit) { return lit.var + lit.sign; } void watch(Literal lit, Clause* cls) out { assert((*this[lit]).length > 0); } body { } } void main() {} -- It does not segfault if the out-contract is not included.
Comment #1
by tobias — 2012-06-25T13:45:06Z
Using arrays instead of Array!T it segfaults if this[lit] is used in watch. If I write _watchlist[lit] instead it works
Comment #2
by bugzilla — 2013-10-06T23:23:41Z
This does not segfault, and runs successfully, on dmd 2.064 head.