[PATCH] D115530: [GlobalOpt][Evaluator] Rewrite global ctor evaluation (fixes PR51879)
Jon Roelofs via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 10 10:05:03 PST 2021
jroelofs added a comment.
Elegant solution, I like it!
================
Comment at: llvm/lib/Transforms/Utils/Evaluator.cpp:189
+ Type *MVType = MV->getType();
+ MV->~MutableValue();
+ if (Ty->isIntegerTy() && MVType->isPointerTy())
----------------
The lifetime of `MV` (or even possibly `this`) ends here, and I think that makes it UB to write to `Val` below. Maybe the dtor's body needs to be outlined & called here explicitly instead of the dtor itself?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115530/new/
https://reviews.llvm.org/D115530
More information about the llvm-commits
mailing list