aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2001-06-01 06:26:11 +0000
committernyamatongwe <devnull@localhost>2001-06-01 06:26:11 +0000
commit91e5161d442421f412315eadc9f3869d104f606f (patch)
tree062e41cdcfb4b14daed708db4ecd9d136fde81b6 /src
parent72d775189307a1859230eb67ce82832daa59c6d4 (diff)
downloadscintilla-mirror-91e5161d442421f412315eadc9f3869d104f606f.tar.gz
Some assertions from Mark.
Diffstat (limited to 'src')
-rw-r--r--src/CellBuffer.cxx2
-rw-r--r--src/ScintillaBase.cxx3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index 56aa15215..10e0a1859 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -751,6 +751,8 @@ bool CellBuffer::SetStyleAt(int position, char style, char mask) {
bool CellBuffer::SetStyleFor(int position, int lengthStyle, char style, char mask) {
int bytePos = position * 2 + 1;
bool changed = false;
+ PLATFORM_ASSERT(lengthStyle == 0 ||
+ (lengthStyle > 0 && lengthStyle + position < length));
while (lengthStyle--) {
char curVal = ByteAt(bytePos);
if ((curVal & mask) != style) {
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index db8040340..707f59b9f 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -362,6 +362,9 @@ void ScintillaBase::Colourise(int start, int end) {
end = lengthDoc;
int len = end - start;
+ PLATFORM_ASSERT(len >= 0);
+ PLATFORM_ASSERT(start + len <= lengthDoc);
+
//WindowAccessor styler(wMain.GetID(), props);
DocumentAccessor styler(pdoc, props, wMain.GetID());