www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7886] New: derivedMembers infinite recursion

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

           Summary: derivedMembers infinite recursion
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: code klickverbot.at


--- Comment #0 from klickverbot <code klickverbot.at> 2012-04-10 16:10:57 PDT
---
Another regression in DMD 2.059 Git (7c22b8a) compared to D 2.058:
---
struct A {
  static if (__traits(derivedMembers, A).length) {}
}
---

The reason is quite obvious from the backtrace, DMD recurses infinitely while
trying to get the list of members even if the static if doesn't add members:
---
#0  0x001e70ec in TraitsExp::semantic (this=0xbf800288, sc=0x352000) at
traits.c:77
#1  0x000be883 in UnaExp::semantic (this=0x426d00, sc=0x681b70) at
expression.c:5844
#2  0x000e1d54 in DotIdExp::semantic (this=0x426d00, sc=0x681b70, flag=0) at
expression.c:6450
#3  0x000c0520 in DotIdExp::semantic (this=0x426d00, sc=0x681b70) at
expression.c:6382
#4  0x0007e78d in StaticIfCondition::include (this=0x426d20, sc=0x681b70,
s=0x0) at cond.c:257
#5  0x000071d2 in ConditionalDeclaration::include (this=0x426d60, sc=0x681ac0,
sd=0x0) at attrib.c:1242
#6  0x0008b92a in ScopeDsymbol::foreach (sc=0x681ac0, members=0x426bc0,
dg=0x1e9630 <_ZZN9TraitsExp8semanticEP5ScopeEN12PushIdentsDg2dgEPvmP7Dsymbol>,
ctx=0x681b50, pn=0x0) at dsymbol.c:1148
.
.
.
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 10 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7886



--- Comment #1 from github-bugzilla puremagic.com 2012-04-10 19:05:47 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/5e555d5fb8570ce27aafa5cdd4fb29a99e813c76
fix Issue 7886 - derivedMembers infinite recursion

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 10 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7886


Walter Bright <bugzilla digitalmars.com> changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 10 2012