On Saturday, 21 December 2013 at 01:14:05 UTC, Jakob Ovrum wrote:
Anyway, I know for a fact that one can easily make DMD go into an infinite loop in various ways, so you'd have to implement some kind of timeout (not talking about CTFE here, which I think is self-limiting).
Yes, I implemented a timeout of just a few seconds (7s, I think). It's short so that it doesn't take too long to test with all the compiler versions. I actually tested that the template recursion is limited (500) but not CTFE (at least in my check of that it was still executing after about 15 minutes). That's also why there is already a test called "infinite CTFE", I wanted to make sure that a DOS could not be achieved with a single test case (but is still easy at the moment, since I don't have rate limiting ;))
