Thread overview
[Issue 2715] New: Access Violation at writefln with interface
Mar 08, 2009
d-bugmail
Mar 29, 2009
d-bugmail
Mar 29, 2009
d-bugmail
May 02, 2009
d-bugmail
March 08, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2715

           Summary: Access Violation at writefln with interface
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: rayerd.wiz@gmail.com


import std.stdio;
interface A {}
void main()
{
        A x;
        writefln(x);
}

C:\D\dmd\windows\bin\..\..\src\phobos\std\format.d(2050): Error: no property
'toString' for type 'a.A'
C:\D\dmd\windows\bin\..\..\src\phobos\std\format.d(2051): template
std.stdio.PrivateFileWriter!(char).PrivateFileWriter.write(C) does not match
any function template declaration
C:\D\dmd\windows\bin\..\..\src\phobos\std\format.d(2051): template
std.stdio.PrivateFileWriter!(char).PrivateFileWriter.write(C) cannot deduce
template function from argument types !()(int)

<-- dmd died here!


-- 

March 29, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2715





------- Comment #1 from unknown@simplemachines.org  2009-03-28 23:53 -------
Created an attachment (id=296)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=296&action=view)
Fix e1->type when clearing this->type within CallExp.

This is crashing within CallExp::canThrow(), since e1->type is NULL.  I assume
checkSideAffect() might have this happen too.

As I read the code, e1->type hasn't been properly set yet where I've patched. Since we don't have f anyway, I think Type::terror is the right thing to set it to.  This does fix the crash, and doesn't spit out any confusing error messages (other than before.)

I am concerned there may be other places (other Expression's canThrow/etc.?) that have this same issue.  My understanding of the code is probably to limited to evaluate that.

-[Unknown]


-- 

March 29, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2715


unknown@simplemachines.org changed:

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




------- Comment #2 from unknown@simplemachines.org  2009-03-29 01:50 -------
Created an attachment (id=298)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=298&action=view)
Fix e1->type when clearing this->type within CallExp (corrected.)

I screwed this patch up, sorry about that.  I used a batch script and forgot to kill echo in it.  This version is the same as above but a valid diff file.

-[Unknown]


-- 

May 02, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2715


bugzilla@digitalmars.com changed:

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




------- Comment #3 from bugzilla@digitalmars.com  2009-05-02 10:04 -------
Works dmd 2.029 and 1.042


--