Home Dashboard Directory Help
Search

std::copy should not check _Dest when _First == _Last by Jocelyn Turcotte


Status: 

Active


4
0
Sign in
to vote
Type: Bug
ID: 558044
Opened: 5/10/2010 4:25:59 AM
Access Restriction: Public
0
Workaround(s)
view
4
User(s) can reproduce this bug

Description

In std::copy when _ITERATOR_DEBUG_LEVEL != 0:

"_DEBUG_RANGE(_First, _Last)" verifies pointers only if _First != _Last.
However, "_DEBUG_POINTER(_Dest)" verifies that _Dest is non-null even if _First == _Last.

This causes an assert to be raised in debug for cases where no problem is faced in release.

This happens in WebKit where a Vector's buffer is deleted before calling std::copy when the source is empty.
Details
Sign in to post a comment.
Posted by perolov on 2/9/2011 at 2:18 AM
Hi Stephan,

I'm wondering if there is a service pack released (or planned) which fixes this? If not, what is the best work-around (to introduce at the entire development department). Having _ITERATOR_DEBUG_LEVEL=0 does not seem like a good idea, or?
/Per-Olov
Posted by Microsoft on 11/1/2010 at 4:06 AM
Hi,

Thanks for reporting this bug. We've fixed it, and the fix will be available in VC11.

If you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by Grégory JAEGY on 7/1/2010 at 12:04 AM
I was wondering if an issue has already been found, as I am experiencing exactly the same issue here.
Posted by Microsoft on 5/10/2010 at 7:28 PM
Thanks for your feedback. We were able to reproduce the issue you are seeing. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 5/10/2010 at 5:02 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.