From c513724d7bfa9b92b20200e4c3c6f138ed4a194c Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Fri, 17 Jan 2020 13:40:56 +0100 Subject: [PATCH] Do not store reference to a temporary Seems to have worked by accident. I could swear that I had fixed this.. --- src/parse_execution.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parse_execution.cpp b/src/parse_execution.cpp index faec8ff0a..0a1a0aa64 100644 --- a/src/parse_execution.cpp +++ b/src/parse_execution.cpp @@ -1019,7 +1019,7 @@ eval_result_t parse_execution_context_t::apply_variable_assignments( const wcstring &source = variable_assignment.get_source(pstree->src); auto equals_pos = variable_assignment_equals_pos(source); assert(equals_pos); - const wcstring &variable_name = source.substr(0, *equals_pos); + const wcstring variable_name = source.substr(0, *equals_pos); const wcstring expression = source.substr(*equals_pos + 1); completion_list_t expression_expanded; parse_error_list_t errors;