|
20 | 20 | #include <goto-programs/set_properties.h>
|
21 | 21 | #include <goto-programs/show_properties.h>
|
22 | 22 | #include <goto-programs/show_symbol_table.h>
|
| 23 | +#include <goto-programs/write_goto_binary.h> |
23 | 24 | #include <java_bytecode/java_bytecode_language.h>
|
24 | 25 | #include <jsil/jsil_language.h>
|
25 | 26 | #include <linking/static_lifetime_init.h>
|
@@ -221,6 +222,21 @@ int sec_driver_parse_optionst::doit()
|
221 | 222 | local_value_sett::do_not_use_precise_access_paths = true;
|
222 | 223 | }
|
223 | 224 |
|
| 225 | + if(cmdline.isset("output-goto-binary")) |
| 226 | + { |
| 227 | + const irep_idt &binary_pathname = cmdline.get_value("goto-binary"); |
| 228 | + status() << "Saving loaded program as GOTO binary." << messaget::eom; |
| 229 | + const bool fail = write_goto_binary( |
| 230 | + as_string(binary_pathname), goto_model, get_message_handler()); |
| 231 | + if(fail) |
| 232 | + { |
| 233 | + error() |
| 234 | + << "ERROR: Call to 'write_goto_binary' has FAILED." << messaget::eom; |
| 235 | + return CPROVER_EXIT_EXCEPTION; |
| 236 | + } |
| 237 | + return CPROVER_EXIT_SUCCESS; |
| 238 | + } |
| 239 | + |
224 | 240 | if(cmdline.isset("security-scanner"))
|
225 | 241 | {
|
226 | 242 | try
|
@@ -631,6 +647,8 @@ void sec_driver_parse_optionst::help()
|
631 | 647 | " a directory. Pass a non existing directory\n"
|
632 | 648 | " path-name with this option. The directory\n"
|
633 | 649 | " will be created with the dumped program.\n"
|
| 650 | + " --output-goto-binary save the input Java program as GOTO binary\n" |
| 651 | + " and exit.\n" |
634 | 652 | "\n"
|
635 | 653 | "Other options:\n"
|
636 | 654 | " --version show version and exit\n"
|
|
0 commit comments