[llvm] r216042 - [dfsan] Treat vararg custom functions like unimplemented functions.
Peter Collingbourne
peter at pcc.me.uk
Tue Aug 19 18:40:24 PDT 2014
Author: pcc
Date: Tue Aug 19 20:40:23 2014
New Revision: 216042
URL: http://llvm.org/viewvc/llvm-project?rev=216042&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
llvm/trunk/test/Instrumentation/DataFlowSanitizer/abilist.ll
Modified: llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp?rev=216042&r1=216041&r2=216042&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp Tue Aug 19 20:40:23 2014
@@ -476,7 +476,7 @@ DataFlowSanitizer::WrapperKind DataFlowS
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;
Modified: llvm/trunk/test/Instrumentation/DataFlowSanitizer/abilist.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Instrumentation/DataFlowSanitizer/abilist.ll?rev=216042&r1=216041&r2=216042&view=diff
==============================================================================
--- llvm/trunk/test/Instrumentation/DataFlowSanitizer/abilist.ll (original)
+++ llvm/trunk/test/Instrumentation/DataFlowSanitizer/abilist.ll Tue Aug 19 20:40:23 2014
@@ -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
}
More information about the llvm-commits
mailing list