diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-03-01 17:20:29 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-03-01 17:20:29 +0100 |
commit | f7ff6020f8c68e4fb54c17c4460aa7f8a31f85bd (patch) | |
tree | e87d085fc6ca10868b8d18936afe70695f65735e /gcc | |
parent | 49dcecd3b6b540e3d8f03623463f2236496c5bcf (diff) | |
download | gcc-f7ff6020f8c68e4fb54c17c4460aa7f8a31f85bd.zip gcc-f7ff6020f8c68e4fb54c17c4460aa7f8a31f85bd.tar.gz gcc-f7ff6020f8c68e4fb54c17c4460aa7f8a31f85bd.tar.bz2 |
lexer: Improve safety by taking ownership of the tokenized string
Co-authored-by: philberty <philip.herron@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/lex/rust-lex.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/lex/rust-lex.h b/gcc/rust/lex/rust-lex.h index b0d7494..c50f632 100644 --- a/gcc/rust/lex/rust-lex.h +++ b/gcc/rust/lex/rust-lex.h @@ -144,7 +144,7 @@ public: /** * Lex the contents of a string instead of a file */ - static Lexer lex_string (std::string &input) + static Lexer lex_string (std::string input) { // We can perform this ugly cast to a non-const char* since we're only // *reading* the string. This would not be valid if we were doing any |