[PATCH] D158743: [Verifier] Sanity check alloca size against DILocalVariable fragment size

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 02:20:42 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/IR/Verifier.cpp:6290
+          (Expr->getNumElements() == 0 ||
+           Expr->expr_op_begin()->getOp() == dwarf::DW_OP_LLVM_fragment)) {
+        CheckDI(*FragSize <= AllocSize->getFixedValue(),
----------------
aprantl wrote:
> aprantl wrote:
> > nikic wrote:
> > > This is my attempt to only handle empty DIExpression or DW_OP_LLVM_fragment, but not things like DW_OP_deref. Is there some cleaner way to check this?
> > Yeah, you need to check that the expression directly points into the alloca and isn't the result computation that uses the contents of the alloca as an input.
> !isComplex() might do what you want.
Thanks, isComplex() was indeed what I was looking for.


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

https://reviews.llvm.org/D158743



More information about the llvm-commits mailing list