Skip to content

Commit 98488bf

Browse files
authored
Merge pull request #1113 from mgudemann/fix/language_set_options_show_parse_tree
Call `get_language_options` on `--show-parse-tree`
2 parents a64e6ed + bb108a3 commit 98488bf

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

src/cbmc/cbmc_parse_options.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ int cbmc_parse_optionst::get_goto_program(
602602
}
603603

604604
languaget *language=get_language_from_filename(filename);
605+
language->get_language_options(cmdline);
605606

606607
if(language==NULL)
607608
{
@@ -751,6 +752,7 @@ void cbmc_parse_optionst::preprocessing()
751752
}
752753

753754
languaget *ptr=get_language_from_filename(filename);
755+
ptr->get_language_options(cmdline);
754756

755757
if(ptr==NULL)
756758
{

src/clobber/clobber_parse_options.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ bool clobber_parse_optionst::get_goto_program(
248248
}
249249

250250
languaget *language=get_language_from_filename(filename);
251+
language->get_language_options(cmdline);
251252

252253
if(language==NULL)
253254
{

src/java_bytecode/java_bytecode_language.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Author: Daniel Kroening, [email protected]
1414
#include <util/config.h>
1515
#include <util/cmdline.h>
1616
#include <util/string2int.h>
17+
#include <util/invariant.h>
1718
#include <json/json_parser.h>
1819

1920
#include <goto-programs/class_hierarchy.h>
@@ -79,6 +80,8 @@ void java_bytecode_languaget::get_language_options(const cmdlinet &cmd)
7980
}
8081
else
8182
java_cp_include_files=".*";
83+
84+
language_options_initialized=true;
8285
}
8386

8487
std::set<std::string> java_bytecode_languaget::extensions() const
@@ -105,6 +108,7 @@ bool java_bytecode_languaget::parse(
105108
std::istream &instream,
106109
const std::string &path)
107110
{
111+
PRECONDITION(language_options_initialized);
108112
java_class_loader.set_message_handler(get_message_handler());
109113
java_class_loader.set_java_cp_include_files(java_cp_include_files);
110114

src/java_bytecode/java_class_loader_limit.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void java_class_loader_limitt::setup_class_load_limit(
1919
std::string &java_cp_include_files)
2020
{
2121
if(java_cp_include_files.empty())
22-
throw "class regexp cannot be empty";
22+
throw "class regexp cannot be empty, `get_language_options` not called?";
2323

2424
// '@' signals file reading with list of class files to load
2525
regex_match=java_cp_include_files[0]!='@';

src/util/language.h

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class languaget:public messaget
137137
static irep_idt get_stub_return_symbol_name(const irep_idt &function_id);
138138

139139
bool generate_opaque_stubs;
140+
bool language_options_initialized=false;
140141

141142
private:
142143
bool is_symbol_opaque_function(const symbolt &symbol);

0 commit comments

Comments
 (0)