diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-02-21 12:24:53 +0100 |
---|---|---|
committer | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-03-30 13:52:32 +0200 |
commit | da81fa1f087b70ab291c87170863eab8a8e1e8d3 (patch) | |
tree | ec9c1b92c2deafce6eb9e133e45fe9bf7d245df4 /gcc/rust/ast/rust-ast-tokenstream.cc | |
parent | acf5db71524e56aef7a0071be96299b976760454 (diff) | |
download | gcc-da81fa1f087b70ab291c87170863eab8a8e1e8d3.zip gcc-da81fa1f087b70ab291c87170863eab8a8e1e8d3.tar.gz gcc-da81fa1f087b70ab291c87170863eab8a8e1e8d3.tar.bz2 |
libproc_macro: Manual Clone for Literal
The Literal type may contain foreign byte array when representing a byte
array or a string. This means auto deriving the Clone trait would only
perform a shallow copy of the pointer rather than a deep copy. This
behavior would lead to use-after-free when a literal is cloned and then
dropped.
ChangeLog:
* librust/proc_macro/rust/bridge/literal.rs: Implement Clone
manually.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/ast/rust-ast-tokenstream.cc')
0 files changed, 0 insertions, 0 deletions