[Issue 13508] array vararg function safety not inferred
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Sat Sep 20 14:05:21 PDT 2014
    
    
  
https://issues.dlang.org/show_bug.cgi?id=13508
hsteoh at quickfur.ath.cx changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh at quickfur.ath.cx
--- Comment #1 from hsteoh at quickfur.ath.cx ---
Array vararg functions are not safe, because they take a slice of arguments on
the stack. Example problem:
-----
class C {
    int[] data;
    this(int[] args...) {
        data = args; // oops: this.data now points to the stack...
    }
}
-----
--
    
    
More information about the Digitalmars-d-bugs
mailing list