diff options
author | Erik Schnetter <schnetter@aei.mpg.de> | 2005-04-11 18:30:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@aei.mpg.de> | 2005-04-11 18:30:00 +0000 |
commit | 2cb54e1839cf63d2303a263330c1d9e637129dab (patch) | |
tree | ea65d46581c37a0bc2ded5f6d6fe369717393677 /Carpet/CarpetLib/src/data.hh | |
parent | ca1636b5bc1eeb42464e44ffa3ad7cb20a4b4aa7 (diff) |
CarpetLib: Correct errors in handling mem<T> objects
I think there were some errors in handling the mem<T> objects, but I'm
not completely sure.
darcs-hash:20050411183030-891bb-f1b5510bb4866c8d4bab48a7b320cb6de71b1121.gz
Diffstat (limited to 'Carpet/CarpetLib/src/data.hh')
-rw-r--r-- | Carpet/CarpetLib/src/data.hh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/data.hh b/Carpet/CarpetLib/src/data.hh index 8d6069de2..f7830c3c1 100644 --- a/Carpet/CarpetLib/src/data.hh +++ b/Carpet/CarpetLib/src/data.hh @@ -75,23 +75,27 @@ public: virtual const void* storage () const { assert (_has_storage); + if (! _memory) return 0; return _memory->storage(vectorindex); } virtual void* storage () { assert (_has_storage); + if (! _memory) return 0; return _memory->storage(vectorindex); } // Data accessors const T& operator[] (const ivect& index) const { + assert (_has_storage); assert (_memory); return _memory->storage(vectorindex)[offset(index)]; } T& operator[] (const ivect& index) { + assert (_has_storage); assert (_memory); return _memory->storage(vectorindex)[offset(index)]; } |