From 27a43baf21a5d3df89ab2ccbaf94f89a76f1f678 Mon Sep 17 00:00:00 2001
From: Markus Blatt <mblatt@dune-project.org>
Date: Mon, 27 Mar 2006 21:23:15 +0000
Subject: [PATCH] Some more asserts.

[[Imported from SVN: r537]]
---
 istl/indexset.hh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/istl/indexset.hh b/istl/indexset.hh
index 244b3aa01..a7386beb0 100644
--- a/istl/indexset.hh
+++ b/istl/indexset.hh
@@ -886,10 +886,13 @@ namespace Dune
     : indexSet_(indexset), size_(size),
       indices_(size_, static_cast<const IndexPair*>(0))
   {
+    assert(size>=indexset.size());
     const_iterator end_ = indexSet_.end();
     size_t i=0;
-    for(const_iterator pair = indexSet_.begin(); pair!=end_; ++pair, ++i)
+    for(const_iterator pair = indexSet_.begin(); pair!=end_; ++pair, ++i) {
+      assert(pair->local()<size_);
       indices_[pair->local()] = &(*pair);
+    }
   }
 
   template<class I>
-- 
GitLab