Skip to content

Commit 0de2fd5

Browse files
Fix invalid java type descriptor
A java type descriptor "Ljava.lang.String;" was parsed into a class identifier "java::java$lang$String". It should have been "Ljava/lang/String;", which is then correctly parsed into "java::java/lang/String". This caused for example the main function not correctly recognized if passed as --function MyClass.main.
1 parent 9b60a26 commit 0de2fd5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/java_bytecode/java_entry_point.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ exprt::operandst java_build_arguments(
178178
if(!is_main)
179179
{
180180
bool named_main=has_suffix(config.main, ".main");
181-
const typet &string_array_type=
182-
java_type_from_string("[Ljava.lang.String;");
181+
const typet &string_array_type =
182+
java_type_from_string("[Ljava/lang/String;");
183183
// checks whether the function is static and has a single String[] parameter
184184
const code_typet &function_type = to_code_type(function.type);
185185
bool has_correct_type = function_type.return_type().id() == ID_empty &&

0 commit comments

Comments
 (0)