@@ -312,7 +312,9 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
312312// / For the task, build the appropriate kind of analyzer
313313// / Ideally this should be a pure function of options.
314314// / However at the moment some domains require the goto_model
315- ai_baset *goto_analyzer_parse_optionst::build_analyzer (const optionst &options)
315+ ai_baset *goto_analyzer_parse_optionst::build_analyzer (
316+ const optionst &options,
317+ const namespacet &ns)
316318{
317319 ai_baset *domain = nullptr ;
318320
@@ -325,7 +327,7 @@ ai_baset *goto_analyzer_parse_optionst::build_analyzer(const optionst &options)
325327 }
326328 else if (options.get_bool_option (" dependence-graph" ))
327329 {
328- domain=new dependence_grapht (namespacet (goto_model. symbol_table ) );
330+ domain=new dependence_grapht (ns );
329331 }
330332 else if (options.get_bool_option (" intervals" ))
331333 {
@@ -349,7 +351,7 @@ ai_baset *goto_analyzer_parse_optionst::build_analyzer(const optionst &options)
349351 }
350352 else if(options.get_bool_option("dependence-graph"))
351353 {
352- domain=new dependence_grapht(namespacet(goto_model.symbol_table) );
354+ domain=new dependence_grapht(ns );
353355 }
354356 else if(options.get_bool_option("intervals"))
355357 {
@@ -612,7 +614,8 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
612614
613615 // Build analyzer
614616 status () << " Selecting abstract domain" << eom;
615- std::unique_ptr<ai_baset> analyzer (build_analyzer (options));
617+ namespacet ns (goto_model.symbol_table ); // Must live as long as the domain.
618+ std::unique_ptr<ai_baset> analyzer (build_analyzer (options, ns));
616619
617620 if (analyzer == nullptr )
618621 {
0 commit comments