[Issue 2990] TypeInfo.init() returns invalid array

2014-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2990

Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

Version|1.044   |D1

--


[Issue 2990] TypeInfo.init() returns invalid array

2011-04-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2990


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #2 from Walter Bright bugzi...@digitalmars.com 2011-04-05 
11:31:07 PDT ---
This is deliberate, see the typinf.c code:

// void[] init;
dtsize_t(pdt, sd-structsize);   // init.length
if (sd-zeroInit)
dtsize_t(pdt, 0);// NULL for 0 initialization
else
dtxoff(pdt, sd-toInitializer(), 0, TYnptr);// init.ptr

I'll fix the documentation.

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


[Issue 2990] TypeInfo.init() returns invalid array

2011-04-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2990


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


--- Comment #3 from Walter Bright bugzi...@digitalmars.com 2011-04-05 
11:41:20 PDT ---
https://github.com/D-Programming-Language/druntime/commit/a771c11bfe357ac2c6c87e96b39e8986286222f5

https://github.com/D-Programming-Language/phobos/commit/50a73bef9ac0e6f8bbc713c1ded85a8254175feb

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


[Issue 2990] TypeInfo.init() returns invalid array

2011-01-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2990


Steven Schveighoffer schvei...@yahoo.com changed:

   What|Removed |Added

 CC||schvei...@yahoo.com


--- Comment #1 from Steven Schveighoffer schvei...@yahoo.com 2011-01-07 
06:46:51 PST ---
This is really a documentation issue.  The init() is correct, as I discovered
when fixing a recent bug.

Essentially, when the ptr is null, but the length is non-zero, the meaning is
that the init value for that type is init().length bytes of zero.  This cuts
down on having to store an array of zeros in the binary.

The documentation for init() says:

Return default initializer, null if default initialize to 0

Which seems to indicate init() should return null if default initializer should
be zero.  But a null array has length == 0.

I think the right solution to this is to change the documentation:

Return default initializer.  If the type should be initialized to all zeros,
an array with a null ptr and a length equal to the type size will be returned

Sound good?

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


[Issue 2990] TypeInfo.init() returns invalid array

2011-01-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2990


nfx...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX


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


[Issue 2990] TypeInfo.init() returns invalid array

2011-01-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2990


Brad Roberts bra...@puremagic.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||bra...@puremagic.com
 Resolution|WONTFIX |


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