mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
eea374d04e
Summary: Change the dynamic cast in CallBase::getCalledFunction() to allow null-valued function operands. This patch fixes a crash that occurred when a funtion operand of a call instruction was dropped, and later on a metadata-carrying instruction was printed out. When allocating the metadata slot numbers, getCalledFunction() would be invoked on the call with the dropped operand, resulting in a failed non-null assertion in isa<>. This fixes PR38924, in which a printout in DBCE crashed due to this. This aligns getCalledFunction() with getCalledValue(), as the latter allows the operand to be null. Reviewers: vsk, dexonsmith, hfinkel Reviewed By: dexonsmith Subscribers: hfinkel, llvm-commits Differential Revision: https://reviews.llvm.org/D52537 llvm-svn: 345966