File tree Expand file tree Collapse file tree 2 files changed +14
-17
lines changed
Expand file tree Collapse file tree 2 files changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ void java_class_loader_limitt::setup_class_load_limit(
2222 throw " class regexp cannot be empty, `get_language_options` not called?" ;
2323
2424 // '@' signals file reading with list of class files to load
25- regex_match= java_cp_include_files[0 ]!= ' @' ;
26- if (regex_match )
25+ use_regex_match = java_cp_include_files[0 ] != ' @' ;
26+ if (use_regex_match )
2727 regex_matcher=std::regex (java_cp_include_files);
2828 else
2929 {
@@ -49,16 +49,14 @@ void java_class_loader_limitt::setup_class_load_limit(
4949
5050// / \par parameters: class file name
5151// / \return true if file should be loaded, else false
52- bool java_class_loader_limitt::load_class_file (const irep_idt &file_name)
52+ bool java_class_loader_limitt::load_class_file (const std::string &file_name)
5353{
54- if (regex_match )
54+ if (use_regex_match )
5555 {
56- return std::regex_match (
57- id2string (file_name),
58- string_matcher,
59- regex_matcher);
56+ std::smatch string_matches;
57+ return std::regex_match (file_name, string_matches, regex_matcher);
6058 }
61- // load .class file only if it is in the match set
6259 else
63- return set_matcher.find (id2string (file_name))!=set_matcher.end ();
60+ // load .class file only if it is in the match set
61+ return set_matcher.find (file_name) != set_matcher.end ();
6462}
Original file line number Diff line number Diff line change 2020
2121class java_class_loader_limitt :public messaget
2222{
23+ // / Whether to use regex_matcher instead of set_matcher
24+ bool use_regex_match;
2325 std::regex regex_matcher;
2426 std::set<std::string> set_matcher;
25- bool regex_match;
26- std::smatch string_matcher;
2727
2828 void setup_class_load_limit (const std::string &);
2929
3030public:
3131 explicit java_class_loader_limitt (
32- message_handlert &_message_handler,
33- const std::string &java_cp_include_files):
34- messaget(_message_handler),
35- regex_match(false )
32+ message_handlert &message_handler,
33+ const std::string &java_cp_include_files)
34+ : messaget(message_handler)
3635 {
3736 setup_class_load_limit (java_cp_include_files);
3837 }
3938
40- bool load_class_file (const irep_idt &class_file_name);
39+ bool load_class_file (const std::string &class_file_name);
4140};
4241
4342#endif
You can’t perform that action at this time.
0 commit comments