This may not be right in all cases, but it's better than asserting which it was doing before. PR 7528. llvm-svn: 108268