From fc0664c638afe7cf0415f30c4f75a6b8c72da9e2 Mon Sep 17 00:00:00 2001 From: Tori Date: Tue, 23 Dec 2025 12:44:11 +0100 Subject: [PATCH] Fix address sanitizer stack-use-after-scope std::make_tuple here will copy the arguments into a tuple so it creates a copy of SmallVector subsliceOffsets and then passes back a tuple with an ArrayRef. The SmallVector object is then out of scope. Bypassing make_tuple means that it uses the underlying AllocationSlice's reference to subsliceOffsets rather than the temporary copy created by make_tuple. --- include/triton/Analysis/Membar.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/triton/Analysis/Membar.h b/include/triton/Analysis/Membar.h index 3e4ed9c3faba..9491ca9f5d54 100644 --- a/include/triton/Analysis/Membar.h +++ b/include/triton/Analysis/Membar.h @@ -47,8 +47,7 @@ struct AllocationSlice { private: std::tuple, const void *, llvm::ArrayRef> asTuple() const { - return std::make_tuple(allocationInterval, accessTy.getAsOpaquePointer(), - subsliceOffsets); + return {allocationInterval, accessTy.getAsOpaquePointer(), subsliceOffsets}; } // Offsets from subslice. Empty when offsets are unknown SmallVector subsliceOffsets;