Skip to content

Commit

Permalink
Fix ICE when emitting an error during cfg strip
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
P-E-P committed Sep 26, 2023
1 parent 4d6a009 commit f285cd2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gcc/rust/rust-session-manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();

Expand Down

0 comments on commit f285cd2

Please sign in to comment.