[PATCH] D15002: [safestack] Fix handling of array allocas.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 25 17:12:56 PST 2015

eugenis added inline comments.

Comment at: lib/Transforms/Instrumentation/SafeStack.cpp:187
@@ +186,3 @@
+  if (AI->isArrayAllocation()) {
+    auto C = dyn_cast<ConstantInt>(AI->getArraySize());
+    if (!C)
eugenis wrote:
> Right. Returning 0 for unknown size allocas.
This would check such allocas for safety as if they are size 0, i.e. some operations are still allowed, but not any loads or stores.
We could actually do better by passing down the size as a Value and applying the SCEV magic to it. But (a) one thing at a time and (b) I doubt it actually matters.



More information about the llvm-commits mailing list