This repository was archived by the owner on Feb 5, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +27
-5
lines changed
lib/Transforms/Instrumentation
test/Instrumentation/AddressSanitizer Expand file tree Collapse file tree 2 files changed +27
-5
lines changed Original file line number Diff line number Diff line change 35
35
#include " llvm/IR/Module.h"
36
36
#include " llvm/IR/Type.h"
37
37
#include " llvm/InstVisitor.h"
38
+ #include " llvm/Support/CallSite.h"
38
39
#include " llvm/Support/CommandLine.h"
39
40
#include " llvm/Support/DataTypes.h"
40
41
#include " llvm/Support/Debug.h"
@@ -1130,12 +1131,12 @@ bool AddressSanitizer::runOnFunction(Function &F) {
1130
1131
} else if (isa<MemIntrinsic>(BI) && ClMemIntrin) {
1131
1132
// ok, take it.
1132
1133
} else {
1133
- if (CallInst *CI = dyn_cast<CallInst>(BI)) {
1134
+ CallSite CS (BI);
1135
+ if (CS) {
1134
1136
// A call inside BB.
1135
1137
TempsToInstrument.clear ();
1136
- if (CI->doesNotReturn ()) {
1137
- NoReturnCalls.push_back (CI);
1138
- }
1138
+ if (CS.doesNotReturn ())
1139
+ NoReturnCalls.push_back (CS.getInstruction ());
1139
1140
}
1140
1141
continue ;
1141
1142
}
Original file line number Diff line number Diff line change 1
1
; RUN: opt < %s -asan -S | FileCheck %s
2
2
; AddressSanitizer must insert __asan_handle_no_return
3
- ; before every noreturn call.
3
+ ; before every noreturn call or invoke .
4
4
5
5
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
6
6
target triple = "x86_64-unknown-linux-gnu"
@@ -26,3 +26,24 @@ entry:
26
26
; CHECK-NEXT: unreachable
27
27
unreachable
28
28
}
29
+
30
+ declare i32 @__gxx_personality_v0 (...)
31
+
32
+ define i64 @Invoke1 (i8** %esc ) nounwind uwtable ssp address_safety {
33
+ entry:
34
+ invoke void @MyNoReturnFunc (i32 1 )
35
+ to label %invoke.cont unwind label %lpad
36
+
37
+ invoke .cont:
38
+ ret i64 0
39
+
40
+ lpad:
41
+ %0 = landingpad { i8* , i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8* )
42
+ filter [0 x i8* ] zeroinitializer
43
+ ret i64 1
44
+ }
45
+ ; CHECK: @Invoke1
46
+ ; CHECK: call void @__asan_handle_no_return
47
+ ; CHECK-NEXT: invoke void @MyNoReturnFunc
48
+ ; CHECK: ret i64 0
49
+ ; CHECK: ret i64 1
You can’t perform that action at this time.
0 commit comments