This is tested in http://reviews.llvm.org/D10952, which is a patch that takes advantage of segments with multiple slices and frequently triggers the bug handled here. Without this patch, http://reviews.llvm.org/D10952 will break an existing test. http://reviews.llvm.org/D10951