diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/optimizing/reference_type_propagation.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/optimizing/reference_type_propagation.cc b/compiler/optimizing/reference_type_propagation.cc index f2394f605a..15f4928ebd 100644 --- a/compiler/optimizing/reference_type_propagation.cc +++ b/compiler/optimizing/reference_type_propagation.cc @@ -809,7 +809,11 @@ void ReferenceTypePropagation::UpdateBoundType(HBoundType* instr) { // Make sure that we don't go over the bounded type. ReferenceTypeInfo upper_bound_rti = instr->GetUpperBound(); if (!upper_bound_rti.IsSupertypeOf(new_rti)) { - new_rti = upper_bound_rti; + // Note that the input might be exact, in which case we know the branch leading + // to the bound type is dead. We play it safe by not marking the bound type as + // exact. + bool is_exact = upper_bound_rti.GetTypeHandle()->CannotBeAssignedFromOtherTypes(); + new_rti = ReferenceTypeInfo::Create(upper_bound_rti.GetTypeHandle(), is_exact); } instr->SetReferenceTypeInfo(new_rti); } |