diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-10-26 14:53:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-26 14:53:18 +0000 |
commit | 19461b9e9ca434d69ca2fa00fd3383174841e210 (patch) | |
tree | 3bee6a9d0a8626f0c71b078f9f9afc2e967bd109 /gcc | |
parent | 2bc1c5309206169776bdcab862aa2b3da7fc8c95 (diff) | |
parent | db4b399c25fd3c37e52c6b8dbdf6bc9c0f1deb6c (diff) | |
download | gcc-19461b9e9ca434d69ca2fa00fd3383174841e210.zip gcc-19461b9e9ca434d69ca2fa00fd3383174841e210.tar.gz gcc-19461b9e9ca434d69ca2fa00fd3383174841e210.tar.bz2 |
Merge #1619
1619: parser: Fix ICE in closure parsing r=CohenArthur a=CohenArthur
`pattern` is a `unique_ptr`, which should be set to NULL once `std::move`d, hence causing the ICE as we were dereferencing a NULL pointer to get its location.
Addresses #1612
This should also help bring the MacOS build back to green
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 4ebdcf0..54f3c5c 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -8903,8 +8903,9 @@ Parser<ManagedTokenSource>::parse_closure_param () } } - return AST::ClosureParam (std::move (pattern), pattern->get_locus (), - std::move (type), std::move (outer_attrs)); + auto locus = pattern->get_locus (); + return AST::ClosureParam (std::move (pattern), locus, std::move (type), + std::move (outer_attrs)); } // Parses a grouped or tuple expression (disambiguates). |