Don <> changed:

           What    |Removed                     |Added
           Keywords|                            |patch
            Summary|SEG-V at expression.c:6255  |SEG-V at expression.c:6255
                   |from bad code               |from bad opDispatch

--- Comment #6 from Don <> 2010-01-26 00:06:30 PST ---
Cause: If global.errors && !global.gag, TemplateInstance::semantic doesn't set
'inst'. So this is a possible patch (not recommended) inside template.c:

    if (!global.gag)
        /* Trying to soldier on rarely generates useful messages
         * at this point.
+    inst = this; // error recovery
But, on the other hand, most other functions in expression.c only run
ti->semantic() if there are global.errors.

So this patch to expression.c line 6252 may be better:

Expression *DotTemplateInstanceExp::semantic(Scope *sc)
    printf("DotTemplateInstanceExp::semantic('%s')\n", toChars());
    Expression *eleft;
    Expression *e = new DotIdExp(loc, e1, ti->name);
    e = e->semantic(sc);

    if (e->op == TOKdottd)
+    if (global.errors) return new ErrorExp();
    DotTemplateExp *dte = (DotTemplateExp *)e;
    TemplateDeclaration *td = dte->td;

The same problem occurs in mtype.c, line 6613, 7101, inside ::dotExp(), for
structs and classes, and they should probably have the same fix.
(they shouldn't be running ti->semantic() if there are global errors).

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to