File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 51
51
#include < langapi/language.h>
52
52
53
53
#include < util/config.h>
54
+ #include < util/exception_utils.h>
54
55
#include < util/exit_codes.h>
55
56
#include < util/options.h>
56
57
#include < util/unicode.h>
@@ -197,6 +198,10 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
197
198
}
198
199
else if (cmdline.isset (" simplify" ))
199
200
{
201
+ if (cmdline.get_value (" simplify" ) == " -" )
202
+ throw invalid_command_line_argument_exceptiont (
203
+ " cannot output goto binary to stdout" , " --simplify" );
204
+
200
205
options.set_option (" simplify" , true );
201
206
options.set_option (" outfile" , cmdline.get_value (" simplify" ));
202
207
options.set_option (" general-analysis" , true );
@@ -634,6 +639,9 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
634
639
}
635
640
else if (options.get_bool_option (" simplify" ))
636
641
{
642
+ PRECONDITION (!outfile.empty () && outfile != " -" );
643
+ output_stream.close ();
644
+ output_stream.open (outfile, std::ios::binary);
637
645
result = static_simplifier (goto_model,
638
646
*analyzer,
639
647
options,
You can’t perform that action at this time.
0 commit comments