mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-05 02:07:56 +00:00
Handle bzero and memset in the local analysis, because we were missing the fact
that memset returns its argument!! llvm-svn: 9811
This commit is contained in:
parent
ddfcf87077
commit
eb36733092
@ -39,8 +39,7 @@ struct DSCallSiteIterator {
|
||||
return F->getName() == "printf" || F->getName() == "sscanf" ||
|
||||
F->getName() == "fprintf" || F->getName() == "open" ||
|
||||
F->getName() == "sprintf" || F->getName() == "fputs" ||
|
||||
F->getName() == "fscanf" || F->getName() == "bzero" ||
|
||||
F->getName() == "memset";
|
||||
F->getName() == "fscanf";
|
||||
}
|
||||
|
||||
// isUnresolvableFunction - Return true if this is an unresolvable
|
||||
|
@ -435,8 +435,22 @@ void GraphBuilder::visitCallSite(CallSite CS) {
|
||||
} else if (F->getName() == "realloc") {
|
||||
DSNodeHandle RetNH = getValueDest(*CS.getInstruction());
|
||||
RetNH.mergeWith(getValueDest(**CS.arg_begin()));
|
||||
DSNode *N = RetNH.getNode();
|
||||
if (N) N->setHeapNodeMarker()->setModifiedMarker()->setReadMarker();
|
||||
if (DSNode *N = RetNH.getNode())
|
||||
N->setHeapNodeMarker()->setModifiedMarker()->setReadMarker();
|
||||
return;
|
||||
} else if (F->getName() == "memset") {
|
||||
// Merge the first argument with the return value, and mark the memory
|
||||
// modified.
|
||||
DSNodeHandle RetNH = getValueDest(*CS.getInstruction());
|
||||
RetNH.mergeWith(getValueDest(**CS.arg_begin()));
|
||||
if (DSNode *N = RetNH.getNode())
|
||||
N->setModifiedMarker();
|
||||
return;
|
||||
} else if (F->getName() == "bzero") {
|
||||
// Mark the memory modified.
|
||||
DSNodeHandle H = getValueDest(**CS.arg_begin());
|
||||
if (DSNode *N = H.getNode())
|
||||
N->setModifiedMarker();
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user