digitalmars.D.bugs - [Issue 8292] New: segfaults on out contract
- d-bugmail puremagic.com (59/59) Jun 24 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8292
- d-bugmail puremagic.com (7/7) Jun 25 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8292
- d-bugmail puremagic.com (12/12) Oct 06 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8292
http://d.puremagic.com/issues/show_bug.cgi?id=8292
           Summary: segfaults on out contract
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: tobias pankrath.net
PDT ---
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.
-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
 Jun 24 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8292 PDT --- Using arrays instead of Array!T it segfaults if this[lit] is used in watch. If I write _watchlist[lit] instead it works -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
 Jun 25 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8292
Walter Bright <bugzilla digitalmars.com> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |WORKSFORME
23:23:41 PDT ---
This does not segfault, and runs successfully, on dmd 2.064 head.
-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
 Oct 06 2013








 
  
  
 
 d-bugmail puremagic.com
 d-bugmail puremagic.com 