Skip to content

Commit

Permalink
Tidying up for lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
majakusber committed Mar 28, 2018
1 parent 5cbb758 commit f428247
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/java_bytecode/java_bytecode_convert_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,10 @@ code_typet member_type_lazy(
/// \param lambda_method_handles Vector of lambda method handles (bootstrap
/// methods) of the class where the lambda is called
/// \param index Index of the lambda method handle in the vector
/// \return Symbol of the lambda method if the method handle does not have an
/// unknown type
/// \return Symbol of the lambda method if the method handle has a known type
optionalt<symbolt> java_bytecode_convert_methodt::get_lambda_method_symbol(
const java_class_typet::java_lambda_method_handlest &lambda_method_handles,
const size_t &index)
const size_t index)
{
const symbol_exprt &lambda_method_handle = lambda_method_handles.at(index);
// If the lambda method handle has an unknown type, it does not refer to
Expand Down
2 changes: 1 addition & 1 deletion src/java_bytecode/java_bytecode_convert_method_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class java_bytecode_convert_methodt:public messaget

optionalt<symbolt> get_lambda_method_symbol(
const java_class_typet::java_lambda_method_handlest &lambda_method_handles,
const size_t &index);
const size_t index);

// conversion
void convert(const symbolt &class_symbol, const methodt &);
Expand Down
2 changes: 2 additions & 0 deletions src/java_bytecode/java_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ class java_class_typet:public class_typet

void add_lambda_method_handle(const irep_idt &identifier)
{
// creates a symbol_exprt for the identifier and pushes it in the vector
lambda_method_handles().emplace_back(identifier);
}
void add_unknown_lambda_method_handle()
{
// creates empty symbol_exprt and pushes it in the vector
lambda_method_handles().emplace_back();
}
};
Expand Down
1 change: 0 additions & 1 deletion unit/testing-utils/require_parse_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ require_parse_tree::require_lambda_entry_for_descriptor(
entry.second.method_type == method_type &&
entry.second.lambda_method_ref == lambda_method_ref);
});
INFO("Number of matching lambda method entries: " << matches.size());
REQUIRE(matches.size() == 1);
return matches.at(0).second;
}
Expand Down

0 comments on commit f428247

Please sign in to comment.