From: Vsevolod Stakhov Date: Tue, 31 Aug 2021 12:12:00 +0000 (+0100) Subject: [Fix] Another try to fix references safety X-Git-Tag: 3.1~209 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f29ce0df5ced4301c686ffca154e7f7f2db14ab;p=thirdparty%2Frspamd.git [Fix] Another try to fix references safety Issue: #3871 --- diff --git a/src/libserver/css/css_parser.cxx b/src/libserver/css/css_parser.cxx index ef3d6f6665..d7d56f3e54 100644 --- a/src/libserver/css/css_parser.cxx +++ b/src/libserver/css/css_parser.cxx @@ -319,7 +319,7 @@ auto css_parser::simple_block_consumer(std::unique_ptr &top, /* Ignore whitespaces */ break; default: - tokeniser->pushback_token(std::move(next_token)); + tokeniser->pushback_token(next_token); ret = component_value_consumer(consume_current ? top : block); break; } @@ -379,7 +379,7 @@ auto css_parser::qualified_rule_consumer(std::unique_ptr &to /* Ignore whitespaces */ break; default: - tokeniser->pushback_token(std::move(next_token)); + tokeniser->pushback_token(next_token); ret = component_value_consumer(block); break; }; @@ -442,7 +442,7 @@ auto css_parser::at_rule_consumer(std::unique_ptr &top) -> b want_more = false; break; default: - tokeniser->pushback_token(std::move(next_token)); + tokeniser->pushback_token(next_token); ret = component_value_consumer(block); break; }; @@ -559,11 +559,11 @@ css_parser::consume_css_blocks(const std::string_view &sv) -> std::unique_ptrpushback_token(std::move(next_token)); + tokeniser->pushback_token(next_token); ret = at_rule_consumer(consumed_blocks); break; default: - tokeniser->pushback_token(std::move(next_token)); + tokeniser->pushback_token(next_token); ret = qualified_rule_consumer(consumed_blocks); break; } @@ -595,7 +595,7 @@ css_parser::consume_css_rule(const std::string_view &sv) -> std::unique_ptrpushback_token(std::move(next_token)); + tokeniser->pushback_token(next_token); ret = component_value_consumer(rule_block); break; } diff --git a/src/libserver/css/css_tokeniser.hxx b/src/libserver/css/css_tokeniser.hxx index 36ab33d8a3..ac38df4638 100644 --- a/src/libserver/css/css_tokeniser.hxx +++ b/src/libserver/css/css_tokeniser.hxx @@ -186,8 +186,8 @@ public: auto next_token(void) -> struct css_parser_token; auto get_offset(void) const { return offset; } - auto pushback_token(struct css_parser_token &&t) const -> void { - backlog.push_back(std::forward(t)); + auto pushback_token(const struct css_parser_token &t) const -> void { + backlog.push_back(t); } private: std::string_view input;