aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty/masm
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-06-26 13:25:07 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-26 15:46:04 +0200
commit8c0b5be80215a23d2236d2ad2d1681aa80499cc8 (patch)
treef010e10977b0a1951eeb36a4b2132e2be6d4cdc7 /src/3rdparty/masm
parentb24bf4fc0c728e380c953ed3dfb5613d9547b13a (diff)
Fix failing assertion with MSVC in debug builds in various tests
We re-implemented Vector::begin() and end() by means of dereferencing the return value from std::begin() and then taking the address of it. That causes a failing assertion in MSVC's STL (rightly so!). We did this only to avoid modifying the original YarrJIT.cpp code. This patch instead simplifies our Vector.h stub again and just fixes the two small occurrences in YarrJIT.cpp where it expects vector->begin() to return a pointer instead of an iterator. Change-Id: I2ad137be91ea969ccb310333dffa8d98e5825f8f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/masm')
-rw-r--r--src/3rdparty/masm/masm.pri2
-rw-r--r--src/3rdparty/masm/stubs/wtf/Vector.h23
-rw-r--r--src/3rdparty/masm/yarr/YarrJIT.cpp2
3 files changed, 8 insertions, 19 deletions
diff --git a/src/3rdparty/masm/masm.pri b/src/3rdparty/masm/masm.pri
index 53a950a6d6..93eff88cbd 100644
--- a/src/3rdparty/masm/masm.pri
+++ b/src/3rdparty/masm/masm.pri
@@ -32,6 +32,8 @@ HEADERS += $$PWD/stubs/WTFStubs.h
SOURCES += $$PWD/stubs/Options.cpp
+HEADERS += $$PWD/stubs/wtf/*.h
+
SOURCES += $$PWD/disassembler/Disassembler.cpp
SOURCES += $$PWD/disassembler/UDis86Disassembler.cpp
contains(DEFINES, WTF_USE_UDIS86=1) {
diff --git a/src/3rdparty/masm/stubs/wtf/Vector.h b/src/3rdparty/masm/stubs/wtf/Vector.h
index a32df4f9ad..138a234f2b 100644
--- a/src/3rdparty/masm/stubs/wtf/Vector.h
+++ b/src/3rdparty/masm/stubs/wtf/Vector.h
@@ -55,9 +55,6 @@ namespace WTF {
template <typename T, int capacity = 1, int overflowMode = UnsafeVectorOverflow>
class Vector : public std::vector<T> {
public:
- typedef T* iterator;
- typedef const T* const_iterator;
-
Vector() {}
Vector(int initialSize) : std::vector<T>(initialSize) {}
@@ -70,7 +67,7 @@ public:
inline void append(const Vector<T>& vector)
{
- this->insert(this->std::vector<T>::end(), vector.std::template vector<T>::begin(), vector.std::template vector<T>::end());
+ this->insert(this->end(), vector.begin(), vector.end());
}
inline void append(const T* ptr, size_t count)
@@ -90,33 +87,23 @@ public:
inline void reserveInitialCapacity(size_t size) { this->reserve(size); }
inline void insert(size_t position, T value)
- { this->insert(this->std::vector<T>::begin() + position, value); }
+ { this->insert(this->begin() + position, value); }
inline void grow(size_t size)
{ this->resize(size); }
inline void shrink(size_t size)
- { this->erase(this->std::vector<T>::begin() + size, this->std::vector<T>::end()); }
+ { this->erase(this->begin() + size, this->end()); }
inline void shrinkToFit()
{ this->shrink(this->size()); }
inline void remove(size_t position)
- { this->erase(this->std::vector<T>::begin() + position); }
+ { this->erase(this->begin() + position); }
inline bool isEmpty() const { return this->empty(); }
- inline T &last() { return *(this->std::vector<T>::begin() + this->size() - 1); }
-
- inline iterator begin()
- { return &(*this->std::vector<T>::begin()); }
- inline const_iterator begin() const
- { return &(*this->std::vector<T>::begin()); }
- inline iterator end()
- { return &(*this->std::vector<T>::end()); }
- inline const_iterator end() const
- { return &(*this->std::vector<T>::end()); }
-
+ inline T &last() { return *(this->begin() + this->size() - 1); }
};
template <typename T, int capacity>
diff --git a/src/3rdparty/masm/yarr/YarrJIT.cpp b/src/3rdparty/masm/yarr/YarrJIT.cpp
index 20b26c1eb9..d36cd956de 100644
--- a/src/3rdparty/masm/yarr/YarrJIT.cpp
+++ b/src/3rdparty/masm/yarr/YarrJIT.cpp
@@ -212,7 +212,7 @@ class YarrGenerator : private MacroAssembler {
if (charClass->m_ranges.size()) {
unsigned matchIndex = 0;
JumpList failures;
- matchCharacterClassRange(character, failures, matchDest, charClass->m_ranges.begin(), charClass->m_ranges.size(), &matchIndex, charClass->m_matches.begin(), charClass->m_matches.size());
+ matchCharacterClassRange(character, failures, matchDest, &charClass->m_ranges[0], charClass->m_ranges.size(), &matchIndex, &charClass->m_matches[0], charClass->m_matches.size());
while (matchIndex < charClass->m_matches.size())
matchDest.append(branch32(Equal, character, Imm32((unsigned short)charClass->m_matches[matchIndex++])));