mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
bug 732330 - add assertion in ClusterIterator::Next to check for sane/safe result. r=jdaggett
This commit is contained in:
parent
621a59dc0d
commit
0e562c610f
@ -100,7 +100,10 @@ class ClusterIterator
|
||||
{
|
||||
public:
|
||||
ClusterIterator(const PRUnichar* aText, PRUint32 aLength)
|
||||
: mText(aText), mLimit(aText + aLength), mPos(aText)
|
||||
: mPos(aText), mLimit(aText + aLength)
|
||||
#ifdef DEBUG
|
||||
, mText(aText)
|
||||
#endif
|
||||
{ }
|
||||
|
||||
operator const PRUnichar* () const {
|
||||
@ -114,9 +117,11 @@ public:
|
||||
void Next();
|
||||
|
||||
private:
|
||||
const PRUnichar* mText;
|
||||
const PRUnichar* mLimit;
|
||||
const PRUnichar* mPos;
|
||||
const PRUnichar* mLimit;
|
||||
#ifdef DEBUG
|
||||
const PRUnichar* mText;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // end namespace unicode
|
||||
|
@ -354,6 +354,9 @@ ClusterIterator::Next()
|
||||
mPos++;
|
||||
}
|
||||
}
|
||||
|
||||
NS_ASSERTION(mText < mPos && mPos <= mLimit,
|
||||
"ClusterIterator::Next has overshot the string!");
|
||||
}
|
||||
|
||||
} // end namespace unicode
|
||||
|
Loading…
Reference in New Issue
Block a user