"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "projects/CodeThorn/src/EStateTransferFunctions.C" between
rose-0.11.53.0.tar.gz and rose-0.11.54.0.tar.gz

About: ROSE is a compiler infrastructure to build source-to-source program transformation and analysis tools for large-scale C, C++, UPC, Fortran, OpenMP, Java, Python and PHP applications.

EStateTransferFunctions.C  (rose-0.11.53.0):EStateTransferFunctions.C  (rose-0.11.54.0)
skipping to change at line 1570 skipping to change at line 1570
<<ProgramLocationsReport::findOriginalProgramLocat ionOfLabel(getLabeler(),estate->label()) <<ProgramLocationsReport::findOriginalProgramLocat ionOfLabel(getLabeler(),estate->label())
<<endl; <<endl;
newLabel=edge.target(); newLabel=edge.target();
newPState=*evalResult.estate.pstate(); newPState=*evalResult.estate.pstate();
EState newEstate=createEState(newLabel,cs,newPState); EState newEstate=createEState(newLabel,cs,newPState);
newEStateList.push_back(newEstate); newEStateList.push_back(newEstate);
} else if((evalResult.isTrue() && edge.isType(EDGE_TRUE)) || (evalResult.isF alse() && edge.isType(EDGE_FALSE)) || evalResult.isTop()) { } else if((evalResult.isTrue() && edge.isType(EDGE_TRUE)) || (evalResult.isF alse() && edge.isType(EDGE_FALSE)) || evalResult.isTop()) {
// pass on EState // pass on EState
newLabel=edge.target(); newLabel=edge.target();
newPState=*evalResult.estate.pstate(); newPState=*evalResult.estate.pstate();
if(ReadWriteListener* readWriteListener=getReadWriteListener()) {
#pragma omp critical(VIOLATIONRECORDING) #pragma omp critical(VIOLATIONRECORDING)
readWriteListener->trueFalseEdgeEvaluation(edge,evalResult,estate); {
if(numberOfReadWriteListeners()>0) {
for(auto p : _readWriteListenerMap) {
ReadWriteListener* readWriteListener=p.second;
readWriteListener->trueFalseEdgeEvaluation(edge,evalResult,estate);
}
}
} }
EState newEstate=createEState(newLabel,cs,newPState); EState newEstate=createEState(newLabel,cs,newPState);
newEStateList.push_back(newEstate); newEStateList.push_back(newEstate);
} else if((evalResult.isFalse() && edge.isType(EDGE_TRUE)) || (evalResult.is True() && edge.isType(EDGE_FALSE))) { } else if((evalResult.isFalse() && edge.isType(EDGE_TRUE)) || (evalResult.is True() && edge.isType(EDGE_FALSE))) {
// we determined not to be on an execution path, therefore do nothing (do not add any result to resultlist) // we determined not to be on an execution path, therefore do nothing (do not add any result to resultlist)
//cout<<"DEBUG: not on feasable execution path. skipping."<<endl; //cout<<"DEBUG: not on feasable execution path. skipping."<<endl;
} else { } else {
// all other cases (assume evaluating to true or false, sane as top) // all other cases (assume evaluating to true or false, sane as top)
// pass on EState // pass on EState
newLabel=edge.target(); newLabel=edge.target();
newPState=*evalResult.estate.pstate(); newPState=*evalResult.estate.pstate();
if(ReadWriteListener* readWriteListener=getReadWriteListener()) {
#pragma omp critical(VIOLATIONRECORDING) #pragma omp critical(VIOLATIONRECORDING)
readWriteListener->trueFalseEdgeEvaluation(edge,evalResult,estate); {
if(numberOfReadWriteListeners()>0) {
for(auto p : _readWriteListenerMap) {
ReadWriteListener* readWriteListener=p.second;
readWriteListener->trueFalseEdgeEvaluation(edge,evalResult,estate);
}
}
} }
EState newEstate=createEState(newLabel,cs,newPState); EState newEstate=createEState(newLabel,cs,newPState);
newEStateList.push_back(newEstate); newEStateList.push_back(newEstate);
} }
return newEStateList; return newEStateList;
} }
CodeThorn::EStateTransferFunctions::MemoryUpdateList CodeThorn::EStateTransferFunctions::MemoryUpdateList
CodeThorn::EStateTransferFunctions::evalAssignOpMemUpdates(SgAssignOp* nextNod eToAnalyze2, const EState* estatePtr) { CodeThorn::EStateTransferFunctions::evalAssignOpMemUpdates(SgAssignOp* nextNod eToAnalyze2, const EState* estatePtr) {
MemoryUpdateList memoryUpdateList; MemoryUpdateList memoryUpdateList;
skipping to change at line 1667 skipping to change at line 1681
PState pstate2=oldPState; PState pstate2=oldPState;
VariableId arrayVarId=getVariableIdMapping()->variableId(varRefExp); VariableId arrayVarId=getVariableIdMapping()->variableId(varRefExp);
AbstractValue arrayPtrValue; AbstractValue arrayPtrValue;
// two cases // two cases
if(getVariableIdMapping()->isOfArrayType(arrayVarId)) { if(getVariableIdMapping()->isOfArrayType(arrayVarId)) {
// create array element 0 (in preparation to have index added, or, if not index is used, it is already the correct index (=0). // create array element 0 (in preparation to have index added, or, if not index is used, it is already the correct index (=0).
arrayPtrValue=AbstractValue::createAddressOfArray(arrayVarId); arrayPtrValue=AbstractValue::createAddressOfArray(arrayVarId);
} else if(getVariableIdMapping()->isOfPointerType(arrayVarId)) { } else if(getVariableIdMapping()->isOfPointerType(arrayVarId)) {
// in case it is a pointer retrieve pointer value // in case it is a pointer retrieve pointer value
AbstractValue ptr=AbstractValue::createAddressOfArray(arrayVarId); AbstractValue ptr=AbstractValue::createAddressOfArray(arrayVarId);
if(pstate2.varExists(ptr)) { if(pstate2.memLocExists(ptr)) {
arrayPtrValue=readFromMemoryLocation(estate.label(),&pstate2,ptr); arrayPtrValue=readFromMemoryLocation(estate.label(),&pstate2,ptr);
//cout<<"DEBUG: arrayPtrValue: "<<arrayPtrValue.toString(getVariabl eIdMapping())<<endl; //cout<<"DEBUG: arrayPtrValue: "<<arrayPtrValue.toString(getVariabl eIdMapping())<<endl;
// convert integer to VariableId // convert integer to VariableId
if(arrayPtrValue.isTop()||arrayPtrValue.isBot()) { if(arrayPtrValue.isTop()||arrayPtrValue.isBot()) {
if(getOptionOutputWarnings()) if(getOptionOutputWarnings())
_analyzer->printStatusMessageLine("Warning: "+nextNodeToAnalyze 2->unparseToString()+arrayPtrValue.toString(getVariableIdMapping())+" array inde x is top or bot. Not supported yet."); _analyzer->printStatusMessageLine("Warning: "+nextNodeToAnalyze 2->unparseToString()+arrayPtrValue.toString(getVariableIdMapping())+" array inde x is top or bot. Not supported yet.");
} }
// logger[DEBUG]<<"defering pointer-to-array: ptr:"<<getVariableIdM apping()->variableName(arrayVarId); // logger[DEBUG]<<"defering pointer-to-array: ptr:"<<getVariableIdM apping()->variableName(arrayVarId);
} else { } else {
if(getOptionOutputWarnings()) if(getOptionOutputWarnings())
_analyzer->printStatusMessageLine("Warning: lhs array access: po inter variable does not exis2t in PState:"+ptr.toString()); _analyzer->printStatusMessageLine("Warning: lhs array access: po inter variable does not exis2t in PState:"+ptr.toString());
arrayPtrValue=AbstractValue::createTop(); arrayPtrValue=AbstractValue::createTop();
} }
} else if(getVariableIdMapping()->isOfReferenceType(arrayVarId)) { } else if(getVariableIdMapping()->isOfReferenceType(arrayVarId)) {
AbstractValue ptr=AbstractValue::createAddressOfArray(arrayVarId); AbstractValue ptr=AbstractValue::createAddressOfArray(arrayVarId);
if(pstate2.varExists(ptr)) { if(pstate2.memLocExists(ptr)) {
arrayPtrValue=readFromReferenceMemoryLocation(estate.label(),&pstat e2,ptr); arrayPtrValue=readFromReferenceMemoryLocation(estate.label(),&pstat e2,ptr);
} else { } else {
arrayPtrValue=AbstractValue::createTop(); arrayPtrValue=AbstractValue::createTop();
} }
} else { } else {
fatalErrorExit(nextNodeToAnalyze2,"lhs array access: unknown type of array or pointer."); fatalErrorExit(nextNodeToAnalyze2,"lhs array access: unknown type of array or pointer.");
} }
SingleEvalResult res2=evaluateExpression(indexExp,currentEState); SingleEvalResult res2=evaluateExpression(indexExp,currentEState);
AbstractValue indexValue=res2.value(); AbstractValue indexValue=res2.value();
AbstractValue elementSize=getMemoryRegionAbstractElementSize(arrayPtrVa lue); AbstractValue elementSize=getMemoryRegionAbstractElementSize(arrayPtrVa lue);
skipping to change at line 1886 skipping to change at line 1900
ROSE_ASSERT(nextNodeToAnalyze); ROSE_ASSERT(nextNodeToAnalyze);
TransferFunctionCode tfCode=TransferFunctionCode::Unknown; TransferFunctionCode tfCode=TransferFunctionCode::Unknown;
if(edge.isType(EDGE_LOCAL)) { if(edge.isType(EDGE_LOCAL)) {
tfCode=TransferFunctionCode::FunctionCallLocalEdge; tfCode=TransferFunctionCode::FunctionCallLocalEdge;
} else if(SgNodeHelper::Pattern::matchAssertExpr(nextNodeToAnalyze)) { } else if(SgNodeHelper::Pattern::matchAssertExpr(nextNodeToAnalyze)) {
// handle assert(0) // handle assert(0)
tfCode=TransferFunctionCode::FailedAssert; tfCode=TransferFunctionCode::FailedAssert;
} else if(edge.isType(EDGE_CALL)) { } else if(edge.isType(EDGE_CALL)) {
tfCode=TransferFunctionCode::FunctionCall; tfCode=TransferFunctionCode::FunctionCall;
} else if(edge.isType(EDGE_EXTERNAL)) { } else if(edge.isType(EDGE_EXTERNAL)) {
if(ReadWriteListener* listener=getReadWriteListener()) {
#pragma omp critical(VIOLATIONRECORDING) #pragma omp critical(VIOLATIONRECORDING)
listener->functionCallExternal(edge,estate); {
if(numberOfReadWriteListeners()>0) {
for(auto p : _readWriteListenerMap) {
ReadWriteListener* readWriteListener=p.second;
readWriteListener->functionCallExternal(edge,estate);
}
}
} }
tfCode=TransferFunctionCode::FunctionCallExternal; tfCode=TransferFunctionCode::FunctionCallExternal;
} else if(isSgReturnStmt(nextNodeToAnalyze) && !SgNodeHelper::Pattern::match ReturnStmtFunctionCallExp(nextNodeToAnalyze)) { } else if(isSgReturnStmt(nextNodeToAnalyze) && !SgNodeHelper::Pattern::match ReturnStmtFunctionCallExp(nextNodeToAnalyze)) {
// "return x;": add $return=eval() [but not for "return f();"] // "return x;": add $return=eval() [but not for "return f();"]
tfCode=TransferFunctionCode::ReturnStmt; tfCode=TransferFunctionCode::ReturnStmt;
} else if(isSgAsmStmt(nextNodeToAnalyze)) { } else if(isSgAsmStmt(nextNodeToAnalyze)) {
tfCode=TransferFunctionCode::AsmStmt; tfCode=TransferFunctionCode::AsmStmt;
} else if(getLabeler()->isFunctionEntryLabel(edge.source())) { } else if(getLabeler()->isFunctionEntryLabel(edge.source())) {
tfCode=TransferFunctionCode::FunctionEntry; tfCode=TransferFunctionCode::FunctionEntry;
} else if(getLabeler()->isFunctionExitLabel(edge.source())) { } else if(getLabeler()->isFunctionExitLabel(edge.source())) {
skipping to change at line 2775 skipping to change at line 2794
recordDefinitiveViolatingLocation(ANALYSIS_NULL_POINTER,estate.label()) ; // NP_SOUNDNESS recordDefinitiveViolatingLocation(ANALYSIS_NULL_POINTER,estate.label()) ; // NP_SOUNDNESS
// there is no state following a definitive null pointer // there is no state following a definitive null pointer
// dereference. An error-state recording this property is // dereference. An error-state recording this property is
// created to allow analysis of errors on the programs // created to allow analysis of errors on the programs
// transition graph. In addition the property is also recorded in the _ nullPointerDereferenceLocations list. // transition graph. In addition the property is also recorded in the _ nullPointerDereferenceLocations list.
res.result=CodeThorn::Top(); // consider returning bot here? res.result=CodeThorn::Top(); // consider returning bot here?
// verification error states are detected in the solver and no successo r states are computed. // verification error states are detected in the solver and no successo r states are computed.
res.estate.io.recordVerificationError(); res.estate.io.recordVerificationError();
return res; return res;
} }
if(pstate2.varExists(arrayPtrValue)) { if(pstate2.memLocExists(arrayPtrValue)) {
// required for the following index computation (nothing to do here) // required for the following index computation (nothing to do here)
} else { } else {
if(arrayPtrValue.isTop()) { if(arrayPtrValue.isTop()) {
//logger[ERROR]<<"@"<<SgNodeHelper::lineColumnNodeToString(node)<<" e valArrayReferenceOp: pointer is top. Pointer abstraction too coarse."<<endl; //logger[ERROR]<<"@"<<SgNodeHelper::lineColumnNodeToString(node)<<" e valArrayReferenceOp: pointer is top. Pointer abstraction too coarse."<<endl;
// TODO: PRECISION 1 // TODO: PRECISION 1
res.result=CodeThorn::Top(); res.result=CodeThorn::Top();
recordPotentialNullPointerDereferenceLocation(estate.label()); // NP_ SOUNDNESS recordPotentialNullPointerDereferenceLocation(estate.label()); // NP_ SOUNDNESS
//if(_analyzer->getAbstractionMode()!=3) recordPotentialOutOfBoundsAc cessLocation(estate.label()); //if(_analyzer->getAbstractionMode()!=3) recordPotentialOutOfBoundsAc cessLocation(estate.label());
recordPotentialViolatingLocation(ANALYSIS_UNINITIALIZED,estate.label( )); // UNINIT_SOUNDNESS recordPotentialViolatingLocation(ANALYSIS_UNINITIALIZED,estate.label( )); // UNINIT_SOUNDNESS
return res; return res;
} else { } else {
res.result=CodeThorn::Top(); res.result=CodeThorn::Top();
return res; return res;
} }
ROSE_ASSERT(false); // not reachable ROSE_ASSERT(false); // not reachable
} }
if(pstate2.varExists(arrayPtrPlusIndexValue)) { if(pstate2.memLocExists(arrayPtrPlusIndexValue)) {
// address of denoted memory location // address of denoted memory location
switch(mode) { switch(mode) {
case MODE_VALUE: case MODE_VALUE:
res.result=readFromMemoryLocation(estate.label(),&pstate2,arrayPtrPlu sIndexValue); res.result=readFromMemoryLocation(estate.label(),&pstate2,arrayPtrPlu sIndexValue);
SAWYER_MESG(logger[TRACE])<<"retrieved array element value:"<<res.res ult<<" from "<<arrayPtrPlusIndexValue.toString(_variableIdMapping)<<endl; SAWYER_MESG(logger[TRACE])<<"retrieved array element value:"<<res.res ult<<" from "<<arrayPtrPlusIndexValue.toString(_variableIdMapping)<<endl;
return res; return res;
case MODE_ADDRESS: case MODE_ADDRESS:
res.result=arrayPtrPlusIndexValue; res.result=arrayPtrPlusIndexValue;
return res; return res;
default: default:
skipping to change at line 3885 skipping to change at line 3904
bool EStateTransferFunctions::isGlobalAddress(AbstractValue val) { bool EStateTransferFunctions::isGlobalAddress(AbstractValue val) {
VariableId varId=val.getVariableId(); VariableId varId=val.getVariableId();
if(varId.isValid()) { if(varId.isValid()) {
return getVariableIdMapping()->getVariableIdInfoPtr(varId)->variableScope= =VariableIdMapping::VariableScope::VS_GLOBAL; return getVariableIdMapping()->getVariableIdInfoPtr(varId)->variableScope= =VariableIdMapping::VariableScope::VS_GLOBAL;
} }
return false; return false;
} }
AbstractValue EStateTransferFunctions::conditionallyApplyArrayAbstraction(Abst ractValue val) { AbstractValue EStateTransferFunctions::conditionallyApplyArrayAbstraction(Abst ractValue val) {
//cout<<"DEBUG: condapply: "<<val.toString(_analyzer->getVariableIdMapping() return AbstractValue::conditionallyApplyArrayAbstraction(val);
)<<endl;
int arrayAbstractionIndex=_analyzer->getOptionsRef().arrayAbstractionIndex;
if(arrayAbstractionIndex>=0) {
//cout<<"DEBUG: array abstraction active starting at index: "<<arrayAbstra
ctionIndex<<endl;
if(val.isPtr()&&!val.isNullPtr()) {
VariableId memLocId=val.getVariableId();
if(_analyzer->getVariableIdMapping()->isOfArrayType(memLocId)) {
AbstractValue index=val.getIndexValue();
if(!index.isTop()&&!index.isBot()) {
int offset=val.getIndexIntValue();
auto remappingEntry=_analyzer->getVariableIdMapping()->getOffsetAbstr
actionMappingEntry(memLocId,offset);
if(remappingEntry.getIndexRemappingType()==VariableIdMappingExtended:
:IndexRemappingEnum::IDX_REMAPPED) {
SAWYER_MESG(logger[TRACE])<<"remapping index "<<offset<<" -> "<<rem
appingEntry.getRemappedOffset()<<endl;
val.setValue(remappingEntry.getRemappedOffset());
val.setSummaryFlag(true);
}
}
}
}
}
return val;
} }
AbstractValue EStateTransferFunctions::readFromMemoryLocation(Label lab, PStat ePtr pstate, AbstractValue memLoc) { AbstractValue EStateTransferFunctions::readFromMemoryLocation(Label lab, PStat ePtr pstate, AbstractValue memLoc) {
memLoc=conditionallyApplyArrayAbstraction(memLoc); memLoc=conditionallyApplyArrayAbstraction(memLoc);
// inspect memory location here // inspect memory location here
if(memLoc.isNullPtr()) { if(memLoc.isNullPtr()) {
recordDefinitiveNullPointerDereferenceLocation(lab); recordDefinitiveNullPointerDereferenceLocation(lab);
//return AbstractValue::createBot(); //return AbstractValue::createBot();
return AbstractValue::createTop(); return AbstractValue::createTop();
skipping to change at line 3930 skipping to change at line 3929
recordPotentialViolatingLocation(ANALYSIS_UNINITIALIZED,lab); recordPotentialViolatingLocation(ANALYSIS_UNINITIALIZED,lab);
} else if(!pstate->memLocExists(memLoc)) { } else if(!pstate->memLocExists(memLoc)) {
//recordPotentialOutOfBoundsAccessLocation(lab); //recordPotentialOutOfBoundsAccessLocation(lab);
recordPotentialUninitializedAccessLocation(lab); recordPotentialUninitializedAccessLocation(lab);
} }
AbstractValue val=pstate->readFromMemoryLocation(memLoc); // relegating to p state in esate->readFromMemoryLocation AbstractValue val=pstate->readFromMemoryLocation(memLoc); // relegating to p state in esate->readFromMemoryLocation
// investigate value here // investigate value here
if(val.isUndefined()) { if(val.isUndefined()) {
recordPotentialUninitializedAccessLocation(lab); recordPotentialUninitializedAccessLocation(lab);
} }
if(_readWriteListener) {
#pragma omp critical(VIOLATIONRECORDING) #pragma omp critical(VIOLATIONRECORDING)
_readWriteListener->readingFromMemoryLocation(lab,pstate,memLoc,val); {
if(numberOfReadWriteListeners()>0) {
for(auto p : _readWriteListenerMap) {
ReadWriteListener* readWriteListener=p.second;
readWriteListener->readingFromMemoryLocation(lab,pstate,memLoc,val);
}
}
} }
return val; return val;
} }
void EStateTransferFunctions::writeToMemoryLocation(Label lab, PState* pstate, AbstractValue memLoc, AbstractValue newValue) { void EStateTransferFunctions::writeToMemoryLocation(Label lab, PState* pstate, AbstractValue memLoc, AbstractValue newValue) {
memLoc=conditionallyApplyArrayAbstraction(memLoc); memLoc=conditionallyApplyArrayAbstraction(memLoc);
// inspect everything here // inspect everything here
SAWYER_MESG(logger[TRACE])<<"EStateTransferFunctions::writeToMemoryLocation1 :"<<memLoc.toString(_variableIdMapping)<<endl; SAWYER_MESG(logger[TRACE])<<"EStateTransferFunctions::writeToMemoryLocation1 :"<<memLoc.toString(_variableIdMapping)<<endl;
skipping to change at line 3955 skipping to change at line 3960
recordPotentialOutOfBoundsAccessLocation(lab); recordPotentialOutOfBoundsAccessLocation(lab);
return; return;
} else if(!pstate->memLocExists(memLoc)) { } else if(!pstate->memLocExists(memLoc)) {
SAWYER_MESG(logger[TRACE])<<"EStateTransferFunctions::writeToMemoryLocatio n1: memloc does not exist"<<endl; SAWYER_MESG(logger[TRACE])<<"EStateTransferFunctions::writeToMemoryLocatio n1: memloc does not exist"<<endl;
if(!newValue.isUndefined()) { if(!newValue.isUndefined()) {
recordPotentialOutOfBoundsAccessLocation(lab); recordPotentialOutOfBoundsAccessLocation(lab);
SAWYER_MESG(logger[WARN])<<"writing defined value to memloc not in state: L"<<lab.toString()<<": "<<memLoc.toString(_variableIdMapping)<<":="<<newValue.t oString(_variableIdMapping)<<endl; SAWYER_MESG(logger[WARN])<<"writing defined value to memloc not in state: L"<<lab.toString()<<": "<<memLoc.toString(_variableIdMapping)<<":="<<newValue.t oString(_variableIdMapping)<<endl;
} }
} }
SAWYER_MESG(logger[TRACE])<<"EStateTransferFunctions::writeToMemoryLocation1 : before write"<<endl; SAWYER_MESG(logger[TRACE])<<"EStateTransferFunctions::writeToMemoryLocation1 : before write"<<endl;
if(_readWriteListener) {
#pragma omp critical(VIOLATIONRECORDING) #pragma omp critical(VIOLATIONRECORDING)
_readWriteListener->writingToMemoryLocation(lab,pstate,memLoc,newValue); {
if(numberOfReadWriteListeners()>0) {
for(auto p : _readWriteListenerMap) {
ReadWriteListener* readWriteListener=p.second;
readWriteListener->writingToMemoryLocation(lab,pstate,memLoc,newValue);
}
}
} }
if(memLoc.isNullPtr()) { if(memLoc.isNullPtr()) {
recordDefinitiveNullPointerDereferenceLocation(lab); recordDefinitiveNullPointerDereferenceLocation(lab);
} else { } else {
pstate->writeToMemoryLocation(memLoc,newValue); pstate->writeToMemoryLocation(memLoc,newValue);
} }
SAWYER_MESG(logger[TRACE])<<"EStateTransferFunctions::writeToMemoryLocation1 :done"<<endl; SAWYER_MESG(logger[TRACE])<<"EStateTransferFunctions::writeToMemoryLocation1 :done"<<endl;
} }
AbstractValue EStateTransferFunctions::readFromReferenceMemoryLocation(Label l ab, PStatePtr pstate, AbstractValue memLoc) { AbstractValue EStateTransferFunctions::readFromReferenceMemoryLocation(Label l ab, PStatePtr pstate, AbstractValue memLoc) {
AbstractValue referedMemLoc=readFromMemoryLocation(lab,pstate,memLoc); AbstractValue referedMemLoc=readFromMemoryLocation(lab,pstate,memLoc);
skipping to change at line 4054 skipping to change at line 4066
void EStateTransferFunctions::printLoggerWarning(EState& estate) { void EStateTransferFunctions::printLoggerWarning(EState& estate) {
Label lab=estate.label(); Label lab=estate.label();
if(_analyzer) { if(_analyzer) {
SAWYER_MESG(logger[WARN]) << "at label "<<lab<<": "<<(_analyzer->getLabele r()->getNode(lab)->unparseToString())<<": this pointer set to top."<<endl; SAWYER_MESG(logger[WARN]) << "at label "<<lab<<": "<<(_analyzer->getLabele r()->getNode(lab)->unparseToString())<<": this pointer set to top."<<endl;
} else { } else {
SAWYER_MESG(logger[WARN]) << "at label "<<lab<<": "<<": this pointer set t o top."<<endl; SAWYER_MESG(logger[WARN]) << "at label "<<lab<<": "<<": this pointer set t o top."<<endl;
} }
} }
void EStateTransferFunctions::setReadWriteListener(ReadWriteListener* rwl) { size_t EStateTransferFunctions::numberOfReadWriteListeners() {
#pragma omp critical(VIOLATIONRECORDING) return _readWriteListenerMap.size();
_readWriteListener=rwl;
} }
ReadWriteListener* EStateTransferFunctions::getReadWriteListener() { void EStateTransferFunctions::registerReadWriteListener(ReadWriteListener* rwl
return _readWriteListener; , std::string name) {
ROSE_ASSERT(_readWriteListenerMap.find(name)==_readWriteListenerMap.end());
_readWriteListenerMap[name]=rwl;
}
ReadWriteListener* EStateTransferFunctions::getReadWriteListener(std::string n
ame) {
auto iter=_readWriteListenerMap.find(name);
if(iter==_readWriteListenerMap.end()) {
return nullptr;
} else {
return _readWriteListenerMap.at(name);
}
} }
bool EStateTransferFunctions::isFunctionCallWithAssignment(Label lab,VariableI d* varIdPtr){ bool EStateTransferFunctions::isFunctionCallWithAssignment(Label lab,VariableI d* varIdPtr){
//return _labeler->isFunctionCallWithAssignment(lab,varIdPtr); //return _labeler->isFunctionCallWithAssignment(lab,varIdPtr);
SgNode* node=getLabeler()->getNode(lab); SgNode* node=getLabeler()->getNode(lab);
if(getLabeler()->isFunctionCallLabel(lab)) { if(getLabeler()->isFunctionCallLabel(lab)) {
std::pair<SgVarRefExp*,SgFunctionCallExp*> p=SgNodeHelper::Pattern::matchE xprStmtAssignOpVarRefExpFunctionCallExp2(node); std::pair<SgVarRefExp*,SgFunctionCallExp*> p=SgNodeHelper::Pattern::matchE xprStmtAssignOpVarRefExpFunctionCallExp2(node);
if(p.first) { if(p.first) {
if(varIdPtr) { if(varIdPtr) {
*varIdPtr=getVariableIdMapping()->variableId(p.first); *varIdPtr=getVariableIdMapping()->variableId(p.first);
 End of changes. 20 change blocks. 
45 lines changed or deleted 63 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)