]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fix ICE when emitting an error during cfg strip
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 26 Sep 2023 12:49:10 +0000 (14:49 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:04:37 +0000 (19:04 +0100)
When an error was emitted during the cfg strip pass by the crate loader,
it was ignored and the error state propagated until another pass
(name resolver).

gcc/rust/ChangeLog:

* rust-session-manager.cc (Session::expansion): Add early break on
error.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/rust-session-manager.cc

index 1273b53496c660af2d3c360757102ff9e11bf705..3edd1ecb4ebe79f85a9fec6e0be9d2f0f98e3a16 100644 (file)
@@ -877,6 +877,9 @@ Session::expansion (AST::Crate &crate)
   while (!fixed_point_reached && iterations < cfg.recursion_limit)
     {
       CfgStrip ().go (crate);
+      // Errors might happen during cfg strip pass
+      if (saw_errors ())
+       break;
 
       auto ctx = Resolver2_0::NameResolutionContext ();