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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugd...@yahoo.com.au
            Summary|lazy argument + variadic    |lazy argument + variadic
                   |arguments                   |arguments = segfault




--- Comment #2 from Don <clugd...@yahoo.com.au>  2009-07-02 07:58:19 PDT ---
Reduced test case shows it's an out-by-1 error in grabbing the arguments. The
length ends up in the ptr field.
Probably, it's neglecting the fact that lazy arguments have a pointer as well
as the value, or something similar.

import std.stdarg;

void foo(lazy int expr, ...){
    char[] tmp_msg = va_arg!(char[])(_argptr);
    if (cast(int)(tmp_msg.ptr)=="food_for_thought".length)
         assert(0, "length is in the pointer!");
}

void main(){
  foo(515,"food_for_thought");
}

Applies to D2 as well as D1.

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

Reply via email to