Skip to content

Commit 873e1f6

Browse files
committed
Guess public access for stub globals
Any choice here is wrong (we can't know the global's actual visibility because we don't have the bytecode). I guess at public visibility on the hunch that actually- shared globals are somewhat more common than private ones with the same name and type.
1 parent d6783d8 commit 873e1f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/java_bytecode/java_bytecode_language.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,10 @@ static void create_stub_global_symbol(
405405
new_symbol.base_name = symbol_basename;
406406
new_symbol.type = symbol_type;
407407
new_symbol.type.set(ID_C_class, class_id);
408+
// Public access is a guess; it encourages merging like-typed static fields,
409+
// whereas a more restricted visbility would encourage separating them.
410+
// Neither is correct, as without the class file we can't know the truth.
411+
new_symbol.type.set(ID_C_access, ID_public);
408412
new_symbol.pretty_name = new_symbol.name;
409413
new_symbol.mode = ID_java;
410414
new_symbol.is_type = false;

0 commit comments

Comments
 (0)