diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-09-26 14:49:10 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:04:37 +0100 |
commit | 5757c304b539dc30c5cacf278bb026738288854a (patch) | |
tree | d71d8b7bb9e7c3c1a856c3d383cc3f797593f766 /gcc | |
parent | 1e1e3814ffb0cdd865593d3d42cbf5cbb6f9fa57 (diff) | |
download | gcc-5757c304b539dc30c5cacf278bb026738288854a.zip gcc-5757c304b539dc30c5cacf278bb026738288854a.tar.gz gcc-5757c304b539dc30c5cacf278bb026738288854a.tar.bz2 |
gccrs: Fix ICE when emitting an error during cfg strip
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>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/rust-session-manager.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index 1273b53..3edd1ec 100644 --- a/gcc/rust/rust-session-manager.cc +++ b/gcc/rust/rust-session-manager.cc @@ -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 (); |