Thread overview
[Issue 1571] New: const on function parameters not carried through to .di file
Oct 11, 2007
d-bugmail
[Issue 1571] Segfault(class.c) const on function parameters not carried through to .di file
Sep 10, 2009
Don
Oct 06, 2009
Walter Bright
October 11, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1571

           Summary: const on function parameters not carried through to .di
                    file
           Product: D
           Version: 2.005
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: bugzilla@digitalmars.com


class C;
void foo(const C c);

and compiling with -H gives a .di file that is missing the const.


-- 

September 10, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1571


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|wrong-code                  |ice-on-invalid-code, patch
                 CC|                            |clugdbug@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 <clugdbug@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: -------
October 06, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1571


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2009-10-06 02:12:56 PDT ---
Fixed dmd 1.048 and 2.033

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