Fixes one of the issues in PR51946. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D111277