www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 928] New: nested struct definition in unittest section of a templated class, hangs DMD

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=928

           Summary: nested struct definition in unittest section of a
                    templated class, hangs DMD
           Product: D
           Version: 1.004
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: dkm4i1 gmail.com


The following code seems to make the compiler do some endless loop, because of
the TestType definition.

______________________________________________________

void main()
{
    MinHeap!(int) foo = new MinHeap!(int)();
}

class MinHeap(NodeType)
{
    unittest
    {
        struct TestType {}
        MinHeap!(TestType) foo = new MinHeap!(TestType)();
    }
}


-- 
Feb 03 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=928


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All





Added to DStress as
http://dstress.kuehne.cn/run/u/unittest_11_A.d
http://dstress.kuehne.cn/run/u/unittest_11_B.d
http://dstress.kuehne.cn/run/u/unittest_11_C.d


-- 
Apr 05 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=928


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |clugdbug yahoo.com.au





Straightforward patch. This is just a copy-and-paste of the code for the other
recursive template expansion checks.
Patch against DMD 2.031.

Index: template.c
===================================================================
--- template.c    (revision 194)
+++ template.c    (working copy)
   -3592,7 +3592,27   

     if (sc->func || dosemantic3)
     {
+#if WINDOWS_SEH
+  __try
+  {
+#endif
+    if (++nest > 500)
+    {
+    global.gag = 0;            // ensure error message gets printed
+    error("recursive expansion");
+    fatal();
+    }
     semantic3(sc2);
+    --nest;
+#if WINDOWS_SEH
+  }
+  __except (__ehfilter(GetExceptionInformation()))
+  {
+    global.gag = 0;            // ensure error message gets printed
+    error("recursive expansion");
+    fatal();
+  }
+#endif
     }

   Laftersemantic:

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 12 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=928


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



13:49:58 PDT ---
Fixed dmd 1.049

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 13 2009