[PATCH] D105061: [IR] Fix replaceUsesWithIf ponetial issue with constants
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 28 14:02:26 PDT 2021
efriedma added inline comments.
================
Comment at: llvm/lib/IR/Value.cpp:534
+ SetVector<Constant*> Consts;
+
----------------
I think you need a TrackingVH here, instead of a raw pointer. Suppose you have something like the following:
ConstantStruct(ConstantStruct(C, C), C)
Say we replaceUsesWithIf on C. Calling handleOperandChange on the inner ConstantStruct will invalidate pointers to the outer CostantStruct. So depending on the use-list order, you might have a dangling pointer.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105061/new/
https://reviews.llvm.org/D105061
More information about the llvm-commits
mailing list