Skip to content

Commit ce771d5

Browse files
author
Owen Jones
committed
Fix String initialiser type when java.lang.String is a stub
Previously it was accidentally given type java.lang.Object, but we didn't notice because we were less stringent about verifying type equality (or, in transitioning from ID_symbol to ID_struct_tag for Java types, we've become less generous about permitting a structural match but name mismatch). Either way it was clearly wrong to assign a wrong type like this.
1 parent 4cc978f commit ce771d5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

jbmc/src/java_bytecode/java_string_literals.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ symbol_exprt get_or_create_string_literal_symbol(
204204
// Case where java.lang.String was stubbed, and so directly defines
205205
// @class_identifier
206206
new_symbol.value = jlo_init;
207+
new_symbol.value.type() = string_type;
207208
}
208209

209210
bool add_failed = symbol_table.add(new_symbol);

0 commit comments

Comments
 (0)