Skip to content

Forbid copies of string preprocess #980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/java_bytecode/java_bytecode_convert_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class java_bytecode_convert_classt:public messaget
size_t _max_array_length,
lazy_methodst& _lazy_methods,
lazy_methods_modet _lazy_methods_mode,
const java_string_library_preprocesst &_string_preprocess):
java_string_library_preprocesst &_string_preprocess):
messaget(_message_handler),
symbol_table(_symbol_table),
max_array_length(_max_array_length),
Expand Down Expand Up @@ -63,7 +63,7 @@ class java_bytecode_convert_classt:public messaget
const size_t max_array_length;
lazy_methodst &lazy_methods;
lazy_methods_modet lazy_methods_mode;
java_string_library_preprocesst string_preprocess;
java_string_library_preprocesst &string_preprocess;

// conversion
void convert(const classt &c);
Expand Down Expand Up @@ -477,7 +477,7 @@ bool java_bytecode_convert_class(
size_t max_array_length,
lazy_methodst &lazy_methods,
lazy_methods_modet lazy_methods_mode,
const java_string_library_preprocesst &string_preprocess)
java_string_library_preprocesst &string_preprocess)
{
java_bytecode_convert_classt java_bytecode_convert_class(
symbol_table,
Expand Down
2 changes: 1 addition & 1 deletion src/java_bytecode/java_bytecode_convert_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ bool java_bytecode_convert_class(
size_t max_array_length,
lazy_methodst &,
lazy_methods_modet,
const java_string_library_preprocesst &string_preprocess);
java_string_library_preprocesst &string_preprocess);

#endif // CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_CONVERT_CLASS_H
2 changes: 1 addition & 1 deletion src/java_bytecode/java_bytecode_convert_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2777,7 +2777,7 @@ void java_bytecode_convert_method(
message_handlert &message_handler,
size_t max_array_length,
safe_pointer<ci_lazy_methodst> lazy_methods,
const java_string_library_preprocesst &string_preprocess)
java_string_library_preprocesst &string_preprocess)
{
static const std::unordered_set<std::string> methods_to_ignore
{
Expand Down
4 changes: 2 additions & 2 deletions src/java_bytecode/java_bytecode_convert_method.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ void java_bytecode_convert_method(
message_handlert &message_handler,
size_t max_array_length,
safe_pointer<ci_lazy_methodst> lazy_methods,
const java_string_library_preprocesst &string_preprocess);
java_string_library_preprocesst &string_preprocess);

inline void java_bytecode_convert_method(
const symbolt &class_symbol,
const java_bytecode_parse_treet::methodt &method,
symbol_tablet &symbol_table,
message_handlert &message_handler,
size_t max_array_length,
const java_string_library_preprocesst &string_preprocess)
java_string_library_preprocesst &string_preprocess)
{
java_bytecode_convert_method(
class_symbol,
Expand Down
4 changes: 2 additions & 2 deletions src/java_bytecode/java_bytecode_convert_method_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class java_bytecode_convert_methodt:public messaget
message_handlert &_message_handler,
size_t _max_array_length,
safe_pointer<ci_lazy_methodst> _lazy_methods,
const java_string_library_preprocesst &_string_preprocess):
java_string_library_preprocesst &_string_preprocess):
messaget(_message_handler),
symbol_table(_symbol_table),
max_array_length(_max_array_length),
Expand Down Expand Up @@ -61,7 +61,7 @@ class java_bytecode_convert_methodt:public messaget
irep_idt method_id;
irep_idt current_method;
typet method_return_type;
java_string_library_preprocesst string_preprocess;
java_string_library_preprocesst &string_preprocess;

public:
struct holet
Expand Down
4 changes: 4 additions & 0 deletions src/java_bytecode/java_string_library_preprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class java_string_library_preprocesst:public messaget
bool is_known_string_type(irep_idt class_name);

private:
// We forbid copies of the object
java_string_library_preprocesst(
const java_string_library_preprocesst &)=delete;

static bool java_type_matches_tag(const typet &type, const std::string &tag);
static bool is_java_string_pointer_type(const typet &type);
static bool is_java_string_type(const typet &type);
Expand Down