Skip to content

Commit 7af5b68

Browse files
committed
[DFSan] Directly create gep inbounds for arg origin tls (NFCI)
Calling code explicitly checks that ArgNo is inbounds. NFCI because constant expression creation already infers it, this just makes it explicit.
1 parent df9701b commit 7af5b68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,8 +1804,8 @@ Value *DFSanFunction::getRetvalTLS(Type *T, IRBuilder<> &IRB) {
18041804
Value *DFSanFunction::getRetvalOriginTLS() { return DFS.RetvalOriginTLS; }
18051805

18061806
Value *DFSanFunction::getArgOriginTLS(unsigned ArgNo, IRBuilder<> &IRB) {
1807-
return IRB.CreateConstGEP2_64(DFS.ArgOriginTLSTy, DFS.ArgOriginTLS, 0, ArgNo,
1808-
"_dfsarg_o");
1807+
return IRB.CreateConstInBoundsGEP2_64(DFS.ArgOriginTLSTy, DFS.ArgOriginTLS, 0,
1808+
ArgNo, "_dfsarg_o");
18091809
}
18101810

18111811
Value *DFSanFunction::getOrigin(Value *V) {

0 commit comments

Comments
 (0)