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

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 11:07:22 PDT 2023


aprantl requested changes to this revision.
aprantl added inline comments.
This revision now requires changes to proceed.


================
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(),
----------------
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.


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

https://reviews.llvm.org/D158743



More information about the llvm-commits mailing list