@@ -245,6 +245,10 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
245
245
options.set_option (" trace" , true );
246
246
}
247
247
248
+ if (cmdline.isset (" export-core-goto" ))
249
+ options.set_option (
250
+ " export-core-goto" , cmdline.get_value (" export-core-goto" ));
251
+
248
252
if (cmdline.isset (" localize-faults" ))
249
253
options.set_option (" localize-faults" , true );
250
254
@@ -549,15 +553,23 @@ int cbmc_parse_optionst::doit()
549
553
// At this point, our goto-model should be in core-goto form (all of the
550
554
// transformations have been run and the program is ready to be given to the
551
555
// solver).
552
- if (cmdline. isset (" export-core-goto" ))
556
+ if (options. is_set (" export-core-goto" ))
553
557
{
554
- auto core_goto_filename = cmdline.get_value (" export-core-goto" );
558
+ auto core_goto_filename = options.get_option (" export-core-goto" );
559
+ if (core_goto_filename.empty ())
560
+ {
561
+ log .error ()
562
+ << " ERROR: Please provide a filename to write the goto-binary to."
563
+ << messaget::eom;
564
+ return CPROVER_EXIT_INTERNAL_ERROR;
565
+ }
566
+
555
567
auto success =
556
568
!write_goto_binary (core_goto_filename, goto_model, ui_message_handler);
557
569
558
570
if (!success)
559
571
{
560
- log .error () << " Unable to export goto-program in file "
572
+ log .error () << " ERROR: Unable to export goto-program in file "
561
573
<< core_goto_filename << messaget::eom;
562
574
return CPROVER_EXIT_INTERNAL_ERROR;
563
575
}
0 commit comments