[Issue 4733] Possible bugs caused by dynamic arrays in boolean evaluation context
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Nov 30 08:50:59 PST 2013
https://d.puremagic.com/issues/show_bug.cgi?id=4733
Martin Nowak <code at dawg.eu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |code at dawg.eu
--- Comment #18 from Martin Nowak <code at dawg.eu> 2013-11-30 08:50:56 PST ---
(In reply to comment #10)
> (In reply to comment #8)
> > Or simply: use arr.length != 0
>
> That is not the same as `if (arr)`, and I don't want this to make people
> accidentally break their code.
The difference between !!arr.ptr and !!arr.length is always a bug,
because accessing an array with non-null ptr but zero length is a range error.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list