From 539db2549f8aa9c50681423e2ebce40b7b79ce9f Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 11 May 2017 11:57:01 +0100 Subject: [PATCH] Fix use-after-free bugs --- src/goto-programs/string_refine_preprocess.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/goto-programs/string_refine_preprocess.cpp b/src/goto-programs/string_refine_preprocess.cpp index 6a908f281f8..bbba1b8d49a 100644 --- a/src/goto-programs/string_refine_preprocess.cpp +++ b/src/goto-programs/string_refine_preprocess.cpp @@ -755,7 +755,7 @@ void string_refine_preprocesst::make_string_function( code_function_callt &function_call=to_code_function_call(target->code); code_typet function_type=to_code_type(function_call.function().type()); code_typet new_type; - const source_locationt &loc=function_call.source_location(); + const source_locationt loc=function_call.source_location(); declare_function(function_name, function_type); function_application_exprt rhs; std::vector args; @@ -1074,7 +1074,8 @@ void string_refine_preprocesst::replace_string_calls( { if(target->is_function_call()) { - code_function_callt &function_call=to_code_function_call(target->code); + const code_function_callt function_call= + to_code_function_call(target->code); if(function_call.function().id()==ID_symbol) {