@@ -312,7 +312,9 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
312
312
// / For the task, build the appropriate kind of analyzer
313
313
// / Ideally this should be a pure function of options.
314
314
// / 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)
316
318
{
317
319
ai_baset *domain = nullptr ;
318
320
@@ -325,7 +327,7 @@ ai_baset *goto_analyzer_parse_optionst::build_analyzer(const optionst &options)
325
327
}
326
328
else if (options.get_bool_option (" dependence-graph" ))
327
329
{
328
- domain=new dependence_grapht (namespacet (goto_model. symbol_table ) );
330
+ domain=new dependence_grapht (ns );
329
331
}
330
332
else if (options.get_bool_option (" intervals" ))
331
333
{
@@ -349,7 +351,7 @@ ai_baset *goto_analyzer_parse_optionst::build_analyzer(const optionst &options)
349
351
}
350
352
else if(options.get_bool_option("dependence-graph"))
351
353
{
352
- domain=new dependence_grapht(namespacet(goto_model.symbol_table) );
354
+ domain=new dependence_grapht(ns );
353
355
}
354
356
else if(options.get_bool_option("intervals"))
355
357
{
@@ -612,7 +614,8 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
612
614
613
615
// Build analyzer
614
616
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));
616
619
617
620
if (analyzer == nullptr )
618
621
{
0 commit comments