From: Philip Herron Date: Thu, 20 Apr 2023 10:55:20 +0000 (+0100) Subject: gccrs: Fix ICE in assignment of error type bound predicates X-Git-Tag: basepoints/gcc-15~2619 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd587fbc1de242a389209974f468dcd8094abb74;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/rust/typecheck/rust-tyty-bounds.cc b/gcc/rust/typecheck/rust-tyty-bounds.cc index 23a2926faeba..dc4418ff27b7 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++) {