mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-23 02:32:11 +00:00
[dfsan] Handle bitcast aliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212668 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
515f228ec3
commit
706cbb3337
@ -602,7 +602,7 @@ bool DataFlowSanitizer::runOnModule(Module &M) {
|
|||||||
++i;
|
++i;
|
||||||
// Don't stop on weak. We assume people aren't playing games with the
|
// Don't stop on weak. We assume people aren't playing games with the
|
||||||
// instrumentedness of overridden weak aliases.
|
// 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);
|
bool GAInst = isInstrumented(GA), FInst = isInstrumented(F);
|
||||||
if (GAInst && FInst) {
|
if (GAInst && FInst) {
|
||||||
addGlobalNamePrefix(GA);
|
addGlobalNamePrefix(GA);
|
||||||
@ -612,7 +612,7 @@ bool DataFlowSanitizer::runOnModule(Module &M) {
|
|||||||
// below will take care of instrumenting it.
|
// below will take care of instrumenting it.
|
||||||
Function *NewF =
|
Function *NewF =
|
||||||
buildWrapperFunction(F, "", GA->getLinkage(), F->getFunctionType());
|
buildWrapperFunction(F, "", GA->getLinkage(), F->getFunctionType());
|
||||||
GA->replaceAllUsesWith(NewF);
|
GA->replaceAllUsesWith(ConstantExpr::getBitCast(NewF, GA->getType()));
|
||||||
NewF->takeName(GA);
|
NewF->takeName(GA);
|
||||||
GA->eraseFromParent();
|
GA->eraseFromParent();
|
||||||
FnsToInstrument.push_back(NewF);
|
FnsToInstrument.push_back(NewF);
|
||||||
|
@ -8,7 +8,15 @@ module asm ".symver f1,f@@version1"
|
|||||||
; CHECK: @"dfs$f2" = alias {{.*}} @"dfs$f1"
|
; CHECK: @"dfs$f2" = alias {{.*}} @"dfs$f1"
|
||||||
@f2 = alias void ()* @f1
|
@f2 = alias void ()* @f1
|
||||||
|
|
||||||
|
; CHECK: @"dfs$g2" = alias {{.*}} @"dfs$g1"
|
||||||
|
@g2 = alias bitcast (void (i8*)* @g1 to void (i16*)*)
|
||||||
|
|
||||||
; CHECK: define void @"dfs$f1"
|
; CHECK: define void @"dfs$f1"
|
||||||
define void @f1() {
|
define void @f1() {
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; CHECK: define void @"dfs$g1"
|
||||||
|
define void @g1(i8*) {
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user