[IR] Fix replaceUsesWithIf ponetial issue with constants
There can be a use after free in the Value::replaceUsesWithIf() if two uses point to the same constant. Patch defers handling of the constants past the iterator scan. Another potential issue is that handleOperandChange updates all the uses in a given Constant, not just the one passed to ShouldReplace. Added a FIXME comment. Both issues are not currently exploitable as the only use of this call with constants avoids it. Differential Revision: https://reviews.llvm.org/D105061
Loading
Please sign in to comment