diff options
author | Marc Poulhiès <dkm@kataplop.net> | 2021-06-09 15:20:35 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@kataplop.net> | 2021-06-19 07:41:48 +0200 |
commit | 213b638b3269078d77f02a46602105917616372f (patch) | |
tree | 1f8af0d37c7a6d8597aa30947c288c32f00d1158 /gcc | |
parent | a0c1c0b4001f68c2f4827e65ec23e21fedc2a88d (diff) | |
download | gcc-213b638b3269078d77f02a46602105917616372f.zip gcc-213b638b3269078d77f02a46602105917616372f.tar.gz gcc-213b638b3269078d77f02a46602105917616372f.tar.bz2 |
Fix: do not use object after it has been moved
After std::move(mapping), mapping is unspecified
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/hir/rust-ast-lower-type.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-type.h b/gcc/rust/hir/rust-ast-lower-type.h index 86e802e..5e19850 100644 --- a/gcc/rust/hir/rust-ast-lower-type.h +++ b/gcc/rust/hir/rust-ast-lower-type.h @@ -72,15 +72,15 @@ public: }); auto crate_num = mappings->get_current_crate (); - Analysis::NodeMapping mapping (crate_num, path.get_node_id (), - mappings->get_next_hir_id (crate_num), + auto hirid = mappings->get_next_hir_id (crate_num); + Analysis::NodeMapping mapping (crate_num, path.get_node_id (), hirid, mappings->get_next_localdef_id (crate_num)); + translated = new HIR::TypePath (std::move (mapping), std::move (translated_segments), path.get_locus (), path.has_opening_scope_resolution_op ()); - mappings->insert_hir_type (mapping.get_crate_num (), mapping.get_hirid (), - translated); + mappings->insert_hir_type (crate_num, hirid, translated); } private: |