[PATCH] D48593: Reuse code for calculating allocation size for alloca

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 2 04:42:24 PDT 2018


bjope added inline comments.


================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:625
+    Optional<uint64_t> Size = AI.getAllocationSize(DL);
+    assert(Size && "Unknown alloca size.");
+    return *Size;
----------------
This method is used like this:

```
((!AI.isStaticAlloca()) || getAllocaSizeInBytes(AI) > 0)
```
So I am afraid this assert might blow (the old assert was guarded by AI.isArrayAllocation()).


Repository:
  rL LLVM

https://reviews.llvm.org/D48593





More information about the llvm-commits mailing list