summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-06-02 10:01:42 -0400
committerEliot Horowitz <eliot@10gen.com>2010-06-02 10:03:32 -0400
commit68bcdb17fbebd8d071e6fca845dacd6e940813c2 (patch)
tree3fbed599e82520ffb864382dc77306bf91b3cf25
parent60b052f024a318b949b8c65b6042b3e6fb37b729 (diff)
downloadmongo-68bcdb17fbebd8d071e6fca845dacd6e940813c2.tar.gz
defensive asserts
-rw-r--r--db/instance.cpp8
-rw-r--r--db/pdfile.cpp2
2 files changed, 7 insertions, 3 deletions
diff --git a/db/instance.cpp b/db/instance.cpp
index 909911ebf7b..d8a76cbc38f 100644
--- a/db/instance.cpp
+++ b/db/instance.cpp
@@ -96,11 +96,13 @@ namespace mongo {
scoped_lock bl(Client::clientsMutex);
for( set<Client*>::iterator i = Client::clients.begin(); i != Client::clients.end(); i++ ) {
Client *c = *i;
+ assert( c );
if ( c == &me )
continue;
- CurOp& co = *(c->curop());
- if( all || co.active() )
- vals.push_back( co.infoNoauth() );
+ CurOp* co = c->curop();
+ assert( co );
+ if( all || co->active() )
+ vals.push_back( co->infoNoauth() );
}
}
b.append("inprog", vals);
diff --git a/db/pdfile.cpp b/db/pdfile.cpp
index 65ced5aa589..95bdb171755 100644
--- a/db/pdfile.cpp
+++ b/db/pdfile.cpp
@@ -1532,7 +1532,9 @@ namespace mongo {
assumes ns is capped and no indexes
*/
Record* DataFileMgr::fast_oplog_insert(NamespaceDetails *d, const char *ns, int len) {
+ assert( d );
RARELY assert( d == nsdetails(ns) );
+ DEV assert( d == nsdetails(ns) );
DiskLoc extentLoc;
int lenWHdr = len + Record::HeaderSize;