Fixed to compile and run on origin2000 and origin-pthreads.
[charm.git] / src / ck-core / ckarray.C
index f9dcaba32ae430041a9c64426849ce89b54ad65c..7ce9fac1125eeedda5257a3a919984f1f56855a0 100644 (file)
@@ -271,9 +271,9 @@ void Array1D::RecvForElement(ArrayMessage *msg)
     register int epIdx = msg->entryIndex;
     CkChareID handle = elementIDs[msg->destIndex].elementHandle;
     register void *obj = handle.objPtr;
-    const int index = msg->destIndex;
 
 #if CMK_LBDB_ON
+    const int index = msg->destIndex;
     the_lbdb->ObjectStart(elementIDs[index].ldHandle);
     // Can't use msg after call(): The user may delete it!
     _entryTable[epIdx]->call(msg, obj);