Skip to content

Commit a60ead4

Browse files
thk123svorenova
thk123
authored and
svorenova
committed
Correctly handle nested generic types
Previously looked for first > and ;, but in nested types we need to find the last semi-colon and the matching angle bracket.
1 parent b59c659 commit a60ead4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/java_bytecode/java_types.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ std::vector<typet> java_generic_type_from_string(
454454
const std::string &src)
455455
{
456456
/// the class signature is of the form <TX:Bound_X;TY:Bound_Y;>base_class
457-
size_t signature_end=src.find('>');
457+
size_t signature_end=find_closing_delimiter(src, 0, '<', '>');
458458
INVARIANT(
459459
src[0]=='<' && signature_end!=std::string::npos,
460460
"Class signature has unexpected format");
@@ -463,7 +463,7 @@ std::vector<typet> java_generic_type_from_string(
463463
PRECONDITION(signature[signature.size()-1]==';');
464464

465465
std::vector<typet> types;
466-
size_t var_sep=signature.find(';');
466+
size_t var_sep=signature.rfind(';');
467467
while(var_sep!=std::string::npos)
468468
{
469469
size_t bound_sep=signature.find(':');

0 commit comments

Comments
 (0)