summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2014-08-20 01:40:23 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2014-08-20 01:40:23 +0000
commitf39430bd4aa43a2c1032a1b9e62e64b68d3df8e1 (patch)
tree6b48c9470acc1d0d6bd65495bd14d1e88588e766 /llvm
parentde23726dbd92b72a84b74725f7561adca0f1cee3 (diff)
downloadbcm5719-llvm-f39430bd4aa43a2c1032a1b9e62e64b68d3df8e1.tar.gz
bcm5719-llvm-f39430bd4aa43a2c1032a1b9e62e64b68d3df8e1.zip
[dfsan] Treat vararg custom functions like unimplemented functions.
Because declarations of these functions can appear in places like autoconf checks, they have to be handled somehow, even though we do not support vararg custom functions. We do so by printing a warning and calling the uninstrumented function, as we do for unimplemented functions. llvm-svn: 216042
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp2
-rw-r--r--llvm/test/Instrumentation/DataFlowSanitizer/abilist.ll6
2 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
index 3e11efc0e30..9f5e0bb844d 100644
--- a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
@@ -476,7 +476,7 @@ DataFlowSanitizer::WrapperKind DataFlowSanitizer::getWrapperKind(Function *F) {
return WK_Functional;
if (ABIList.isIn(*F, "discard"))
return WK_Discard;
- if (ABIList.isIn(*F, "custom"))
+ if (ABIList.isIn(*F, "custom") && !F->isVarArg())
return WK_Custom;
return WK_Warning;
diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/abilist.ll b/llvm/test/Instrumentation/DataFlowSanitizer/abilist.ll
index 66ddc140a08..53b7d86dbda 100644
--- a/llvm/test/Instrumentation/DataFlowSanitizer/abilist.ll
+++ b/llvm/test/Instrumentation/DataFlowSanitizer/abilist.ll
@@ -16,6 +16,8 @@ declare void @custom1(i32 %a, i32 %b)
declare i32 @custom2(i32 %a, i32 %b)
+declare void @custom3(...)
+
declare void @customcb(i32 (i32)* %cb)
declare i32 @cb(i32)
@@ -33,6 +35,10 @@ define void @f() {
; CHECK: call void @__dfsw_customcb({{.*}} @"dfst0$customcb", i8* bitcast ({{.*}} @"dfs$cb" to i8*), i16 0)
call void @customcb(i32 (i32)* @cb)
+ ; CHECK: call void @__dfsan_unimplemented
+ ; CHECK: call void (...)* @custom3()
+ call void (...)* @custom3()
+
ret void
}
OpenPOWER on IntegriCloud