Changeset 59463 in webkit


Ignore:
Timestamp:
May 14, 2010 4:24:05 AM (14 years ago)
Author:
jocelyn.turcotte@nokia.com
Message:

Fix a VS2010 assert in std::copy
https://bugs.webkit.org/show_bug.cgi?id=38630

Reviewed by Alexey Proskuryakov.

The assert complains that the output iterator is null.

  • wtf/Vector.h:

(WTF::::operator):

Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r59358 r59463  
     12010-05-10  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Fix a VS2010 assert in std::copy
     6        https://bugs.webkit.org/show_bug.cgi?id=38630
     7
     8        The assert complains that the output iterator is null.
     9
     10        * wtf/Vector.h:
     11        (WTF::::operator):
     12
    1132010-05-13  Maciej Stachowiak  <mjs@apple.com>
    214
  • trunk/JavaScriptCore/wtf/Vector.h

    r58307 r59463  
    687687        }
    688688       
     689// Works around an assert in VS2010. See https://connect.microsoft.com/VisualStudio/feedback/details/558044/std-copy-should-not-check-dest-when-first-last
     690#if COMPILER(MSVC) && defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL
     691        if (!begin())
     692            return *this;
     693#endif
     694
    689695        std::copy(other.begin(), other.begin() + size(), begin());
    690696        TypeOperations::uninitializedCopy(other.begin() + size(), other.end(), end());
     
    710716        }
    711717       
     718// Works around an assert in VS2010. See https://connect.microsoft.com/VisualStudio/feedback/details/558044/std-copy-should-not-check-dest-when-first-last
     719#if COMPILER(MSVC) && defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL
     720        if (!begin())
     721            return *this;
     722#endif
     723
    712724        std::copy(other.begin(), other.begin() + size(), begin());
    713725        TypeOperations::uninitializedCopy(other.begin() + size(), other.end(), end());
Note: See TracChangeset for help on using the changeset viewer.