File tree 2 files changed +14
-17
lines changed
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(
22
22
throw " class regexp cannot be empty, `get_language_options` not called?" ;
23
23
24
24
// '@' 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 )
27
27
regex_matcher=std::regex (java_cp_include_files);
28
28
else
29
29
{
@@ -49,16 +49,14 @@ void java_class_loader_limitt::setup_class_load_limit(
49
49
50
50
// / \par parameters: class file name
51
51
// / \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)
53
53
{
54
- if (regex_match )
54
+ if (use_regex_match )
55
55
{
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);
60
58
}
61
- // load .class file only if it is in the match set
62
59
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 ();
64
62
}
Original file line number Diff line number Diff line change 20
20
21
21
class java_class_loader_limitt :public messaget
22
22
{
23
+ // / Whether to use regex_matcher instead of set_matcher
24
+ bool use_regex_match;
23
25
std::regex regex_matcher;
24
26
std::set<std::string> set_matcher;
25
- bool regex_match;
26
- std::smatch string_matcher;
27
27
28
28
void setup_class_load_limit (const std::string &);
29
29
30
30
public:
31
31
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)
36
35
{
37
36
setup_class_load_limit (java_cp_include_files);
38
37
}
39
38
40
- bool load_class_file (const irep_idt &class_file_name);
39
+ bool load_class_file (const std::string &class_file_name);
41
40
};
42
41
43
42
#endif
You can’t perform that action at this time.
0 commit comments