Don <> changed:

           What    |Removed                     |Added
          Component|Phobos                      |DMD
            Summary|sformat is broken           |Badcode regression: closure
                   |                            |corrupts _argptr value

--- Comment #5 from Don <> 2009-10-15 05:21:36 PDT ---
Reduced test case. This does not seem to be a Phobos bug.
If you remove any reference to s from the delegate (so that it stops being a 
closure), the code works correctly.
void doFormat(void delegate() myputc, void * argptr){
    assert(!(*cast(string*)argptr is null));

void sformat(string s, ...){
    void putc() { assert(s[0]==s[0]); }
    doFormat(&putc, _argptr);

void main(){
    sformat("xxx", "hi");

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

Reply via email to