[PATCH] D111829: [Sanitizers] Replaced getMaxPointerSizeInBits with getPointerSizeInBits, which was causing failures for 32bit x86.

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 15 15:54:31 PDT 2021


vitalybuka added inline comments.


================
Comment at: llvm/lib/Analysis/StackSafetyAnalysis.cpp:157
   TypeSize TS = DL.getTypeAllocSize(AI.getAllocatedType());
-  unsigned PointerSize = DL.getMaxPointerSizeInBits();
+  unsigned PointerSize = DL.getPointerSizeInBits();
   // Fallback to empty range for alloca size.
----------------
nikic wrote:
> The pointer size depends on the address space, you probably want `DL.getPointerTypeSizeInBits(AI.getType())`.
getPointerSizeInBits() should be fine but we need to checks that address space is default. I am not sure this analysis is true for alternative address spaces and current users also ignore non default ones.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111829/new/

https://reviews.llvm.org/D111829



More information about the llvm-commits mailing list