www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 219] New: Compiler crash using string literal in non-extern(D) function call

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=219

           Summary: Compiler crash using string literal in non-extern(D)
                    function call
           Product: D
           Version: 0.161
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: chris dprogramming.com


// Compiler references memory at address 0x00000000
import std.c.windows.windows;
int main() 
{
   HWND hwnd; // ...
   SendMessageA(hwnd, EM_REPLACESEL, TRUE, cast(LPARAM)"foo".ptr);
   return 0; 
}

// Here is a workaround:
import std.c.windows.windows;
int main() 
{
   HWND hwnd; // ...
   char* temp = "foo";
   SendMessageA(hwnd, EM_REPLACESEL, TRUE, cast(LPARAM)temp);
   return 0; 
}


-- 
Jun 22 2006
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=219


bugzilla digitalmars.com changed:

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




------- Comment #1 from bugzilla digitalmars.com  2007-10-02 14:47 -------
Works with DMD 1.021 and 2.004


-- 
Oct 02 2007