1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-17 21:25:58 +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. // Parse the string.
GDBType gdbType = gdbTypeParser.parse(typename); GDBType gdbType = gdbTypeParser.parse(typename);
Type headType = null;
Type type = null; Type type = null;
for (Type aType = null; gdbType != null; type = aType) { for (Type aType = null; gdbType != null; type = aType) {
@ -259,10 +260,14 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
if (type instanceof DerivedType) { if (type instanceof DerivedType) {
((DerivedType)type).setComponentType(aType); ((DerivedType)type).setComponentType(aType);
} }
// Save the head to returning it.
if (headType == null) {
headType = aType;
}
} }
if (type != null) { if (headType != null) {
return type; return headType;
} }
throw new CDIException("Unknown type"); throw new CDIException("Unknown type");
} }