March 01, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4543



--- Comment #9 from Iain Buclaw <ibuclaw@ubuntu.com> 2011-03-01 08:35:31 PST ---
Created an attachment (id=926)
Fix issue4543 segv

Bump.

Patch to prevent ICE from occurring, but doesn't stop the forward reference error.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 01, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4543



--- Comment #10 from Iain Buclaw <ibuclaw@ubuntu.com> 2011-03-01 10:50:34 PST ---
And have no testsuite regressions on Linux as a result of the patch.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 24, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4543


Iain Buclaw <ibuclaw@ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #926 is|0                           |1
           obsolete|                            |


--- Comment #11 from Iain Buclaw <ibuclaw@ubuntu.com> 2011-03-24 12:24:59 PDT ---
Created an attachment (id=934)
issue4543

Attached fix for this issue.

Formal testcase:
=== a4543.d ===
import b4543;

class bclass {};
typedef bclass Tclass;

struct bstruct {}
typedef bstruct Tstruct;

=== b4543.d ===
import a4543;

class A {
    struct {
        Tclass a;
        Tstruct b;
    }
    union {
        Tclass c;
        Tstruct d;
    }
}

struct B {
    struct {
        Tclass a;
        Tstruct b;
    }
    union {
        Tclass c;
        Tstruct d;
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 24, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4543



--- Comment #12 from Iain Buclaw <ibuclaw@ubuntu.com> 2011-03-24 12:41:02 PDT ---
>--- a/src/class.c
>+++ b/src/class.c
>@@ -870,14 +870,14 @@ Dsymbol *ClassDeclaration::search(Loc loc, Identifier *ident, int flags)
>     Dsymbol *s;
>     //printf("%s.ClassDeclaration::search('%s')\n", toChars(), ident->toChars());
> 
>-    if (scope)
>+    if (scope && !symtab)
>     {   Scope *sc = scope;
>         sc->mustsemantic++;
>         semantic(sc);
>         sc->mustsemantic--;
>     }
> 
>-    if (!members || !symtab || scope)
>+    if (!members || !symtab)
>     {
>         error("is forward referenced when looking for '%s'", ident->toChars());
>         //*(char*)0=0;

Here (and in StructDeclaration), if (!symtab) looks to be a sure sign that the
semantic pass hasn't been started yet. Also, if (!members), the semantic won't
run anyway, so you are in trouble even if you do call the semantic in the
search method.

Extending the condition instead to (scope && !symtab) is enough to fix/bypass the forward reference errors for StructDeclaration's while not hurting bug282 which depends on the semantic being called. As for ClassDeclaration's, something extra is needed (as you can see above), I'm not sure of the importance of (scope) *needing* to be NULL here, but removing the check doesn't seem to harm (at least) the testsuite.

Regards

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 19, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4543


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #13 from Walter Bright <bugzilla@digitalmars.com> 2011-04-19 15:23:54 PDT ---
https://github.com/D-Programming-Language/dmd/commit/c9860015025ce73088d8765e83b0b7bc106237e9

https://github.com/D-Programming-Language/dmd/commit/0c68e90db36a2549ccf9d946af803e726b573e07

https://github.com/D-Programming-Language/dmd/commit/930e029c037c48e3444f0ad657719d9f5b5d23c6

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2
Next ›   Last »