summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2014-07-10 01:30:39 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2014-07-10 01:30:39 +0000
commit2e28edf8e1bde1c3d1971758ed9cc3730bf1d61e (patch)
tree9ab55bf394148c4025826260c0a02f80b4ae3e80 /llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
parent8b4e1e2c8d08c7ab186ec2ca3c151fcfd442969a (diff)
downloadbcm5719-llvm-2e28edf8e1bde1c3d1971758ed9cc3730bf1d61e.tar.gz
bcm5719-llvm-2e28edf8e1bde1c3d1971758ed9cc3730bf1d61e.zip
[dfsan] Handle bitcast aliases.
llvm-svn: 212668
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
index 3b9212a14e6..799e14bdac3 100644
--- a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
@@ -602,7 +602,7 @@ bool DataFlowSanitizer::runOnModule(Module &M) {
++i;
// Don't stop on weak. We assume people aren't playing games with the
// instrumentedness of overridden weak aliases.
- if (Function *F = dyn_cast<Function>(GA->getAliasee())) {
+ if (auto F = dyn_cast<Function>(GA->getBaseObject())) {
bool GAInst = isInstrumented(GA), FInst = isInstrumented(F);
if (GAInst && FInst) {
addGlobalNamePrefix(GA);
@@ -612,7 +612,7 @@ bool DataFlowSanitizer::runOnModule(Module &M) {
// below will take care of instrumenting it.
Function *NewF =
buildWrapperFunction(F, "", GA->getLinkage(), F->getFunctionType());
- GA->replaceAllUsesWith(NewF);
+ GA->replaceAllUsesWith(ConstantExpr::getBitCast(NewF, GA->getType()));
NewF->takeName(GA);
GA->eraseFromParent();
FnsToInstrument.push_back(NewF);
OpenPOWER on IntegriCloud