Skip to content

[TG-2684] Bugfix/fix bootstrapmethods empty optional #1908

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
Binary file added regression/cbmc-java/lambda2/SymStream.class
Binary file not shown.
1 change: 1 addition & 0 deletions regression/cbmc-java/lambda2/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from https://github.com/symphonyoss/symphony-java-client/
9 changes: 9 additions & 0 deletions regression/cbmc-java/lambda2/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
KNOWNBUG
SymStream.class
--verbosity 10 --show-goto-functions
lambda function reference org/symphonyoss/symphony/clients/model/SymUser\.toSymUser in class \"SymStream\"
^EXIT=0
^SIGNAL=0
--
--
lambda functions without "lambda$" prefix aren't recognized currently TG-2691
8 changes: 8 additions & 0 deletions regression/cbmc-java/lambda2/test_no_crash.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
SymStream.class
--verbosity 10 --show-goto-functions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add EXIT=0 to ensure it really doesn't crash!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, and add SIGNAL - cf. #1905.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completed the regression tests with tests on EXIT and SIGNAL

^EXIT=0
^SIGNAL=0
--
--
just to test that it doesn't crash in this situation, cf. TG-2684
14 changes: 11 additions & 3 deletions src/java_bytecode/java_bytecode_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1893,10 +1893,18 @@ void java_bytecode_parsert::read_bootstrapmethods_entry(classt &parsed_class)
optionalt<lambda_method_handlet> lambda_method_handle =
parse_method_handle(method_handle_infot{method_handle_argument});

if(
!lambda_method_handle.has_value() ||
if(!lambda_method_handle.has_value())
{
lambda_method_handlet lambda_method_handle;
lambda_method_handle.handle_type = method_handle_typet::UNKNOWN_HANDLE;
lambda_method_handle.u2_values = std::move(u2_values);
parsed_class.lambda_method_handle_map[{parsed_class.name, i}] =
lambda_method_handle;
return;
}
else if(
lambda_method_handle->handle_type !=
method_handle_typet::LAMBDA_METHOD_HANDLE)
method_handle_typet::LAMBDA_METHOD_HANDLE)
{
lambda_method_handle->u2_values = std::move(u2_values);
error() << "ERROR: could not parse lambda function method handle"
Expand Down