[Issue 14419] New: [CTFE] Need infinite loop detection?

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Apr 6 09:12:48 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14419

          Issue ID: 14419
           Summary: [CTFE] Need infinite loop detection?
           Product: D
           Version: D1 & D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

This was noticed and raised in GDC Bugzilla #178 because of a typo in the code.

http://bugzilla.gdcproject.org/show_bug.cgi?id=178


What it boils down to is this:
---
int foo() { while (true) { } return 1; }
enum bar = foo;  // User meant to type '&foo'
---

Perfectly valid code causing an infinite loop in CTFE.  Obviously this is a bug
vs. feature argument, but infinite loop detection should really be a feature of
CTFE to avoid accidental build bugs from occurring.

--


More information about the Digitalmars-d-bugs mailing list