aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty/masm/yarr/YarrPattern.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/masm/yarr/YarrPattern.cpp')
-rw-r--r--src/3rdparty/masm/yarr/YarrPattern.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/3rdparty/masm/yarr/YarrPattern.cpp b/src/3rdparty/masm/yarr/YarrPattern.cpp
index 3ce0216e5f..ae527f065f 100644
--- a/src/3rdparty/masm/yarr/YarrPattern.cpp
+++ b/src/3rdparty/masm/yarr/YarrPattern.cpp
@@ -191,7 +191,8 @@ private:
void addSorted(Vector<UChar>& matches, UChar ch)
{
unsigned pos = 0;
- unsigned range = matches.size();
+ ASSERT(matches.size() <= UINT_MAX);
+ unsigned range = static_cast<unsigned>(matches.size());
// binary chop, find position to insert char.
while (range) {
@@ -216,7 +217,8 @@ private:
void addSortedRange(Vector<CharacterRange>& ranges, UChar lo, UChar hi)
{
- unsigned end = ranges.size();
+ ASSERT(ranges.size() <= UINT_MAX);
+ unsigned end = static_cast<unsigned>(ranges.size());
// Simple linear scan - I doubt there are that many ranges anyway...
// feel free to fix this with something faster (eg binary chop).
@@ -427,7 +429,8 @@ public:
PatternTerm& lastTerm = m_alternative->lastTerm();
- unsigned numParenAlternatives = parenthesesDisjunction->m_alternatives.size();
+ ASSERT(parenthesesDisjunction->m_alternatives.size() <= UINT_MAX);
+ unsigned numParenAlternatives = static_cast<unsigned>(parenthesesDisjunction->m_alternatives.size());
unsigned numBOLAnchoredAlts = 0;
for (unsigned i = 0; i < numParenAlternatives; i++) {