From 028a5bb8ed10c202d024a544b9ca3087a0fcd90c Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Thu, 20 Apr 2023 11:55:20 +0100 Subject: gccrs: Fix ICE in assignment of error type bound predicates gcc/rust/ChangeLog: * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::operator=): we are done if other is in an error state Signed-off-by: Philip Herron --- gcc/rust/typecheck/rust-tyty-bounds.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/rust') diff --git a/gcc/rust/typecheck/rust-tyty-bounds.cc b/gcc/rust/typecheck/rust-tyty-bounds.cc index 6f946bd..defa0ec 100644 --- a/gcc/rust/typecheck/rust-tyty-bounds.cc +++ b/gcc/rust/typecheck/rust-tyty-bounds.cc @@ -360,6 +360,9 @@ TypeBoundPredicate::operator= (const TypeBoundPredicate &other) for (const auto &p : other.get_substs ()) substitutions.push_back (p.clone ()); + if (other.is_error ()) + return *this; + std::vector mappings; for (size_t i = 0; i < other.used_arguments.get_mappings ().size (); i++) { -- cgit v1.1