[Bug 178] cc1d locks up when specifying function instead of function pointer in an array

via D.gnu d.gnu at puremagic.com
Mon Apr 6 08:38:39 PDT 2015


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

--- Comment #7 from Jens Bauer <jens-bugzilla at gpio.dk> ---
(In reply to Ketmar Dark from comment #5)
> private immutable ubyte[256] tblParity = genParityTable();
> 
> it's vital to understand that `tblParity` is initialized in COMPILE time,
> there is no runtime function calls.

I agree; CTFE is a good feature, indeed.
Does this happen only for immutable assignments ?
If so, then the problem is not so big, but it still is nasty, when the compiler
locks up.

Detection could probably be tricky. I would expect that even if checking the
condition given to while() could fail, so that when there's in fact no lock-up,
it would happen as well.
And a naive 32-bit loop-counter would probably not do well either.

Recognizing a while(constant){ ... } would of course help.
I think that it all boils down to if there's a branch-back without any kind of
conditional exit instruction in the generated code, it would work quite well
(but would probably not be completely foolproof).

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20150406/a185c0d7/attachment.html>


More information about the D.gnu mailing list