The following function produces a segv when the begin() is taken from vmap, the ScalarMap... bool StaticMemAnalysis::isSingleMalloc(DSGraph* theGraph,DSNode* theNode) { int count = 0; std::map<Value*, DSNodeHandle>& vmap = theGraph->getScalarMap(); for (std::map<Value*, DSNodeHandle>::iterator i = vmap.begin(); i != vmap.end(); ++i) { if(i->second.getNode() == theNode) { if(isa<MallocInst>(i->first)) count++; } } if(count == 1) return true; return false; } This code used to work... Has something changed or is our code wrong? I rebuilt two days ago... Dave
> The following function produces a segv when the begin() is taken from > vmap, the ScalarMap... > int count = 0; > std::map<Value*, DSNodeHandle>& vmap = theGraph->getScalarMap();Are you sure "theGraph" is not null at this point? -Chris> for (std::map<Value*, DSNodeHandle>::iterator i = vmap.begin(); i > != vmap.end(); ++i) { > if(i->second.getNode() == theNode) { > if(isa<MallocInst>(i->first)) count++; > } > } > if(count == 1) return true; > return false; > } > > This code used to work... Has something changed or is our code wrong? I > rebuilt two days ago... > > Dave > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev >-Chris -- http://llvm.cs.uiuc.edu/ http://www.nondot.org/~sabre/Projects/
On Thu, 28 Nov 2002, Chris Lattner wrote:> > > The following function produces a segv when the begin() is taken from > > vmap, the ScalarMap... > > int count = 0; > > std::map<Value*, DSNodeHandle>& vmap = theGraph->getScalarMap(); > > Are you sure "theGraph" is not null at this point?yes... that call returns sucessfully. the segfault occurs after...> > -Chris > > > for (std::map<Value*, DSNodeHandle>::iterator i = vmap.begin(); i > > != vmap.end(); ++i) { > > if(i->second.getNode() == theNode) { > > if(isa<MallocInst>(i->first)) count++; > > } > > } > > if(count == 1) return true; > > return false; > > } > > > > This code used to work... Has something changed or is our code wrong? I > > rebuilt two days ago... > > > > Dave > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > -Chris > >