From 68bcdb17fbebd8d071e6fca845dacd6e940813c2 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Wed, 2 Jun 2010 10:01:42 -0400 Subject: defensive asserts --- db/instance.cpp | 8 +++++--- db/pdfile.cpp | 2 ++ 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::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; -- cgit v1.2.1