http://d.puremagic.com/issues/show_bug.cgi?id=1571


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|wrong-code                  |ice-on-invalid-code, patch
                 CC|                            |clugd...@yahoo.com.au
            Summary|const on function           |Segfault(class.c) const on
                   |parameters not carried      |function parameters not
                   |through to .di file         |carried through to .di file


--- Comment #1 from Don <clugd...@yahoo.com.au> 2009-09-10 14:21:20 PDT ---
This now segfaults. crashing ClassDeclaration::toCBuffer on members->dim when
members is null.

With the attached patch, as well as preventing the crash, the correct output is
produced.

Patch: class.c line 735 and 749. should ensure class has members,
before writing the members out!

+if(members){
    buf->writenl();
    buf->writeByte('{');
        buf->writenl();
    for (int i = 0; i < members->dim; i++)
    {
        Dsymbol *s = (Dsymbol *)members->data[i];

        buf->writestring("    ");

        s->toCBuffer(buf, hgs);
        }
        buf->writestring("}");
 +   }    else    buf->writestring(";");

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

Reply via email to