Bug 12487 – DMD correctly reports excessive CTFE recursion, but not template recursion

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-28T06:56:00Z
Last change time
2015-10-04T07:40:04Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
lultimouomo

Attachments

IDFilenameSummaryContent-TypeSize
1340recursion.dTest case for crashing the compilerapplication/octet-stream291

Comments

Comment #0 by lultimouomo — 2014-03-28T06:56:19Z
Created attachment 1340 Test case for crashing the compiler Compiling the attached test case reports: recursion.d(6): Error: function recursion.recFunction CTFE recursion limit exceeded recursion.d(7): called from here: recFunction(i) recursion.d(6): 1000 recursive calls to function recFunction recursion.d(14): called from here: recFunction(0) if dmd is run with -version=RecFunction, which makes very easy to spot the bug, but just prints Killed after running out of memory if run with -version=RecTemplate.
Comment #1 by dlang-bugzilla — 2014-03-30T04:32:53Z
Duplicate of issue 12485?
Comment #2 by k.hara.pg — 2015-06-09T16:14:52Z
In 2.067 and git-head, -version=RecTemplate compilation reports: test.d(3): Error: circular initialization of recTemplate test.d(11): Error: template instance test.recTemplate!int error instantiating Therefore the segfault issue is already fixed. However I think the diagnostic "circular initialization of recTemplate" is still unhelpful a little.
Comment #3 by k.hara.pg — 2015-06-09T16:33:18Z
Comment #4 by github-bugzilla — 2015-10-04T07:40:03Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/193ad12dde7b57b26efd5577a4a2b5562ba1ed3a fix Issue 12487 - DMD correctly reports excessive CTFE recursion, but not template recursion https://github.com/D-Programming-Language/dmd/commit/d072c72581b22be0e04161d46b227807d975e17c Merge pull request #4731 from 9rnsr/fix12487 Issue 12487 - DMD correctly reports excessive CTFE recursion, but not template recursion