File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
lib/Transforms/Instrumentation
test/Instrumentation/AddressSanitizer Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -1219,7 +1219,9 @@ struct FunctionStackPoisoner : public InstVisitor<FunctionStackPoisoner> {
12191219
12201220 std::optional<TypeSize> Size = AI->getAllocationSize (AI->getDataLayout ());
12211221 // Check that size is known and can be stored in IntptrTy.
1222- if (!Size || !ConstantInt::isValueValidForType (IntptrTy, *Size))
1222+ // TODO: Add support for scalable vectors if possible.
1223+ if (!Size || Size->isScalable () ||
1224+ !ConstantInt::isValueValidForType (IntptrTy, *Size))
12231225 return ;
12241226
12251227 bool DoPoison = (ID == Intrinsic::lifetime_end);
Original file line number Diff line number Diff line change 1+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+ ; RUN: opt < %s -passes='asan<use-after-scope>' -S | FileCheck %s
3+
4+ define void @test () #1 {
5+ ; CHECK-LABEL: define void @test(
6+ ; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
7+ ; CHECK-NEXT: [[ENTRY:.*:]]
8+ ; CHECK-NEXT: [[CTX_PG:%.*]] = alloca <vscale x 16 x i1>, align 2
9+ ; CHECK-NEXT: call void @llvm.lifetime.start.p0(ptr [[CTX_PG]])
10+ ; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr inttoptr (i64 17592186044416 to ptr), align 1
11+ ; CHECK-NEXT: [[TMP1:%.*]] = icmp ne i8 [[TMP0]], 0
12+ ; CHECK-NEXT: br i1 [[TMP1]], label %[[BB2:.*]], label %[[BB3:.*]]
13+ ; CHECK: [[BB2]]:
14+ ; CHECK-NEXT: call void @__asan_report_store8(i64 0) #[[ATTR4:[0-9]+]]
15+ ; CHECK-NEXT: unreachable
16+ ; CHECK: [[BB3]]:
17+ ; CHECK-NEXT: store ptr [[CTX_PG]], ptr null, align 8
18+ ; CHECK-NEXT: ret void
19+ ;
20+ entry:
21+ %ctx_pg = alloca <vscale x 16 x i1 >, align 2
22+ call void @llvm.lifetime.start.p0 (ptr %ctx_pg )
23+ store ptr %ctx_pg , ptr null , align 8
24+ ret void
25+ }
26+
27+ attributes #1 = { sanitize_address }
You can’t perform that action at this time.
0 commit comments