diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-12-14 11:35:22 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-12-14 11:36:33 +0100 |
commit | 95dc11475dac06b5eecd904079de8aa94827a36a (patch) | |
tree | df3f13a3351eea222a41e6cb6581c848969d3c5c /contrib/gcc-changelog/git_commit.py | |
parent | e165214777acfe5621ad36e55b16e098d50e1596 (diff) | |
download | gcc-95dc11475dac06b5eecd904079de8aa94827a36a.zip gcc-95dc11475dac06b5eecd904079de8aa94827a36a.tar.gz gcc-95dc11475dac06b5eecd904079de8aa94827a36a.tar.bz2 |
rust: Fix up aarch64-linux bootstrap [PR106072]
Bootstrap fails on aarch64-linux and some other arches with:
.../gcc/rust/parse/rust-parse-impl.h: In member function ‘Rust::AST::ClosureParam Rust::Parser<ManagedTokenSource>::parse_closure_param() [with ManagedTokenSource = Rust::Lexer]’:
.../gcc/rust/parse/rust-parse-impl.h:8916:49: error: ‘this’ pointer is null [-Werror=nonnull]
The problem is that while say on x86_64-linux the side-effects in the
arguments are evaluated from last argument to first, on aarch64-linux
it is the other way around, from first to last. The C++ I believe even
in C++17 makes the evaluation of those side-effects unordered
(indeterminately sequenced with no interleaving), so that is fine.
But, when the call in return statement is evaluated from first to
last, std::move (pattern) happens before pattern->get_locus () and
the former will make pattern (std::unique_ptr) a wrapper object around
nullptr, so dereferencing it later to call get_locus () on it is invalid.
2022-12-14 Jakub Jelinek <jakub@redhat.com>
PR rust/106072
* parse/rust-parse-impl.h (parse_closure_param): Store
pattern->get_locus () in a temporary before std::move (pattern) is
invoked.
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
0 files changed, 0 insertions, 0 deletions