aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2023-04-20 11:55:20 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:34:13 +0100
commitcd587fbc1de242a389209974f468dcd8094abb74 (patch)
treeed3ce384efa68662357102dd0b271058a09b40a9
parentb237dcd81a3e84653b2599aae2826fe6221d81a6 (diff)
downloadgcc-cd587fbc1de242a389209974f468dcd8094abb74.zip
gcc-cd587fbc1de242a389209974f468dcd8094abb74.tar.gz
gcc-cd587fbc1de242a389209974f468dcd8094abb74.tar.bz2
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 <herron.philip@googlemail.com>
-rw-r--r--gcc/rust/typecheck/rust-tyty-bounds.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/typecheck/rust-tyty-bounds.cc b/gcc/rust/typecheck/rust-tyty-bounds.cc
index 23a2926..dc4418f 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<SubstitutionArg> mappings;
for (size_t i = 0; i < other.used_arguments.get_mappings ().size (); i++)
{