1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

Save the head of the type for the return value.

This commit is contained in:
Alain Magloire 2003-06-03 19:46:07 +00:00
parent cf3d839940
commit c7c666408a

View file

@ -232,6 +232,7 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
// Parse the string.
GDBType gdbType = gdbTypeParser.parse(typename);
Type headType = null;
Type type = null;
for (Type aType = null; gdbType != null; type = aType) {
@ -259,10 +260,14 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
if (type instanceof DerivedType) {
((DerivedType)type).setComponentType(aType);
}
// Save the head to returning it.
if (headType == null) {
headType = aType;
}
}
if (type != null) {
return type;
if (headType != null) {
return headType;
}
throw new CDIException("Unknown type");
}