[llvm] [ASan] Prevent assert from scalable vectors in FunctionStackPoisoner. (PR #155357)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 27 05:54:44 PDT 2025


================
@@ -1219,7 +1219,8 @@ struct FunctionStackPoisoner : public InstVisitor<FunctionStackPoisoner> {
 
     std::optional<TypeSize> Size = AI->getAllocationSize(AI->getDataLayout());
     // Check that size is known and can be stored in IntptrTy.
-    if (!Size || !ConstantInt::isValueValidForType(IntptrTy, *Size))
+    if (!Size || Size->isScalable() ||
----------------
sdesmalen-arm wrote:

My concern is that other places in the AddressSanitizer where `isInterestingAlloca` returns `true` also don't support scalable vectors, not just the case that was described in that new test case, i.e. for a case we haven't hit yet. If you can confirm that all other cases where the AddressSanitizer encounters a scalable alloca can be handled correctly, I'm happy with the fix.

https://github.com/llvm/llvm-project/pull/155357


More information about the llvm-commits mailing list