[Issue 9975] pointsTo asserts because of false pointer in union

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 18 01:53:08 PDT 2013


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



--- Comment #8 from Martin Nowak <code at dawg.eu> 2013-06-18 01:53:05 PDT ---
(In reply to comment #7)
> (In reply to comment #6)
> > This function is used throughout std.algorithm so marking this as documented
> > behavior is not a good solution because it mean basic algorithms like sort
> > can't be used with such structs.
> 
> Which behavior exactly are you mentioning? And do you mean *any* structs, or
> just structs containing unions?
> 
Returning false positives.
Any struct that might trigger false positives on pointsTo.

It's really a serious issue, I stumbled over this while sorting JSON values.
I don't think we can afford to say that sort or swap can't be used with
algebraic types because they trigger false positive assertions.
Of course this is mainly an issue with swap so we need to look at both sides.

> Could you explain in more detail what you think is wrong and/or what should be
changed?

Maybe it's possible to mitigate the problem by reliably identifying that
something can't be a valid pointer.
But to really fix the swap issue we could make this configurable, i.e. either
add an `ignoreFalsePointer` parameter or return a tri-state result. Then swap
could at least work for most cases.

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


More information about the Digitalmars-d-bugs mailing list